All of lore.kernel.org
 help / color / mirror / Atom feed
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 15:48:14 +0100	[thread overview]
Message-ID: <YYKhLrXVhCgTfNS4@pevik> (raw)
In-Reply-To: <YYKeZRuVLat/xFuS@yuki>

Hi Cyril,

> Hi!
> > +echo 'mounted filesystems (df):'
> > +df_opt=
> > +if ! (df -h 2>&1 | grep -i -q -e 'unknown option' -e 'invalid option'); then df_opt="$df_opt -h"; fi
> > +if ! (df -T 2>&1 | grep -i -q -e 'unknown option' -e 'invalid option'); then df_opt="$df_opt -T"; fi

> Uff that's ugly, can't we simply depend on df returning non-zero on
> invalid option?

On real HW (2 laptops with different linux distros) it fails for something else:
$ df -hT; echo $?
df: /run/user/1000/doc: Operation not permitted
1

If you want simpler form, I suggest
df -hT 2>/dev/null || df

instead of:
df -hT 2>/dev/null || df -h

Which version should I merge?

Kind regards,
Petr

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

  reply	other threads:[~2021-11-03 14:48 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 [this message]
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
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=YYKhLrXVhCgTfNS4@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 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.