3 ms·
I like to use stuff like mountpoint -q $MOUNTPOINT || mount ... Instead of if ! mountpoint -q $MOUNTPOINT; then mount ... fi It's much more compact in t
by sharperguy 7y ago
I like to use stuff like
mountpoint -q $MOUNTPOINT || mount ...
Instead of
if ! mountpoint -q $MOUNTPOINT; then
mount ...
fi
It's much more compact in the case of having a lot of commands that need to be checked in case they don't need to be run again.
- CameronNemo 7y agoI was going to mention this, but frankly it is just a style preference. No real difference between either variant. Also, you can do something like: mountpoint -q /proc || { mount -t proc none /proc chown 0400 /proc/slabinfo } if you need multiple statements.