All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/1] ver_linux: Print filesystems
Date: Wed, 3 Nov 2021 16:38:19 +0100	[thread overview]
Message-ID: <YYKs64osfKyAlcC/@yuki> (raw)
In-Reply-To: <YYKoACdUDPtTeoLb@pevik>

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

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-11-03 15:37 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 [this message]
2021-11-03 16:10           ` Petr Vorel
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=YYKs64osfKyAlcC/@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.