good day, I am creating a script to read one level of subfolders/directories of a path. The script is like so:
#loopdir.sh
for i in `ls -d $1`
do
echo $i
done
But when I tried to use it to read /media/My\ Passport/, it reads the argument as two different dirs:
$ ./loopdir.sh /media/My\ Passport/
ls: cannot access /media/My: No such file or directory
Passport/