Solution for Terminal, double quotation marks create single quotation output
is Given Below:
I’m on my Mac Terminal and I don’t know why but when I make directory, it’s creating a single quotation mark.
It works perfectly fine when there is no space between words
> mkdir "some folder" > ls 'some folder' > mkdir "amazon" > ls 'some folder' amazon
What is causing this? and how do i fix it so that i make a directory called
some folder not
Also I have a python file that creates a csv using the arguments given. But it’s also creating stuff like this:
> python somefile.py "vitamin c" "hi" "dog cat" '"vitamin .csv' 'c".csv' 'hi.csv' '"dog.csv' 'cat".csv'
> python somefile.py "vitamin c" "hi" "dog cat" vitamin c.csv hi.csv dog cat.csv
The folder really is named
some folder, with no quote marks. But the
ls program is trying to be helpful, to make it obvious that it isn’t two directory entries
folder, and to make it easier to copy and paste the name into a valid shell command.
One way to stop
ls from adding the quotes is
ls --literal -1
--literal means not to add any quote marks, backslashes, etc. The
-1 means to make sure there’s one directory entry on each line.