I always do this when passing variable to command
mkdir -p "$dir_to_make"
are those quotes needed? I tried to google but didn't find much. I always write them, just interested if they are necessary.
I always do this when passing variable to command
mkdir -p "$dir_to_make"
are those quotes needed? I tried to google but didn't find much. I always write them, just interested if they are necessary.
A="mydir/My Photos"; mkdir -p $A
(i.e. without the quotes on$A
) you will get three dirs instead of two:./mydir
,./mydir/My
and./Photos
. – grochmal Jul 05 '16 at 13:46