[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Command line mounting all partitions of pluggable device



On Sun, May 19, 2019 at 02:20:19PM +0300, Andrei POPESCU wrote:
>     for $dir in /media/removable/*
>     do
>         mount /dev/disk/by-label/$dir /media/removable/$dir
>     done

for dir in /media/removable/*
do
    mount /dev/disk/by-label/"$dir" /media/removable/"$dir"
done

Note the lack of $ in the first line.  That's a fatal bug.

The quotes around "$dir" in the third line should be used, but if you
forget them, it'll *probably* still work in most cases, because your
directory names probably don't contain spaces or glob characters.
Until that day in the distant future when all of a sudden, they do,
and everything falls down.


Reply to: