From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/1] ver_linux: Print filesystems
Date: Wed, 3 Nov 2021 17:10:58 +0100 [thread overview]
Message-ID: <YYK0kgCo/UeUYfkA@pevik> (raw)
In-Reply-To: <YYKs64osfKyAlcC/@yuki>
> Hi!
> > Ah, sorry, I see why I checked it more complicated way:
> > with simply checking exit code you have output twice:
> > df -hT 2>/dev/null || df
> > Filesystem Type Size Used Avail Use% Mounted on
> > devtmpfs devtmpfs 16G 8,0K 16G 1% /dev
> > tmpfs tmpfs 16G 91M 16G 1% /dev/shm
> > tmpfs tmpfs 6,2G 4,1M 6,2G 1% /run
> > ...
> > df: /run/user/1000/doc: Operation not permitted
> > Filesystem Type Size Used Avail Use% Mounted on
> > devtmpfs devtmpfs 16G 8,0K 16G 1% /dev
> > tmpfs tmpfs 16G 91M 16G 1% /dev/shm
> > tmpfs tmpfs 6,2G 4,1M 6,2G 1% /run
> > ...
> > => which is IMHO nogo. I could redirect to a file and cut it after, but in that
> > case v2 is IMHO much better.
> But still we don't need that grep part, right?
> So it should be something as:
> if `df -hT 2>/dev/null >/dev/null`; then
> df -hT
> else
> df
> fi
Yep, how simple, thanks!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-11-03 16:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-27 7:56 [LTP] [PATCH v2 1/1] ver_linux: Print filesystems Petr Vorel
2021-11-03 14:36 ` Cyril Hrubis
2021-11-03 14:48 ` Petr Vorel
2021-11-03 15:03 ` Cyril Hrubis
2021-11-03 15:17 ` Petr Vorel
2021-11-03 15:38 ` Cyril Hrubis
2021-11-03 16:10 ` Petr Vorel [this message]
2021-11-03 16:20 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YYK0kgCo/UeUYfkA@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).