date=`date +%Y-%m-%d-%H:%M:%S` folder="/folder\ withspace-$date" mkdir $folder cd $folder
This would, to me, make sense to work. That is not the case here, because when I try this in Terminal to test I get this:
$ date=`date +%Y-%m-%d-%H:%M:%S` $ folder="/folder\ withspace-$date" $ sudo mkdir $folder Password: $ ls / [other folders] folder\
So I am really stumped because it also makes another directory in my current directory. What am I doing wrong? Thanks!