On Sun, Dec 21, 2025 at 10:39:29AM +0100, Didier Kryn wrote:
> Le 20/12/2025 à 16:31, Peter via Dng a écrit :
> > if [ findmnt -nrS UUID=$workingVolume ]; then
> > echo "$workingVolume is not mounted"
> > else
> > echo "$workingVolume is mounted"
> > fi
>
> You should note that, for the shell, true==0 and false==1.
>
> This is because the condition is usually tested on command return codes
> with true meaning success.
Actually just remove the brackets:
if findmnt -nrS UUID=$workingVolume ; then
You don't want to test it as an expression, but you want to capture
the success or failure of the command.
Ralph.
>
> -- Didier
>
>
> _______________________________________________
> Dng mailing list
> Dng@???
> Manage your subscription: https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> Archive: https://lists.dyne.org/lurker/list/dng.en.html