[LTP] [PATCH v2 1/1] ver_linux: Print filesystems

Petr Vorel pvorel@suse.cz
Wed Nov 3 16:17:20 CET 2021


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

> Looks good.
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.

Kind regards,
Petr


More information about the ltp mailing list