- Oct
- 358
- 2
Hello — I am not sure if I missed something in the help for quoting but this is what I found.
I was scanning old hard drives for jpg’s that I might have missed along the way moving to new system and came up with a list of files. When I looked at the list, each file was annotated with its full path, and for the most part, many of the files contained blanks in the name. At first I simply just quoted (“) all the files, but I found that I missed some of the files in the list — as it turns out some of the files also contained a the trigger % so there were files like
“foo %bar.jpg”
were not found via the copy command, so checking with the help, what I need to use was the back quote (`) so then when with
`foo %bar.jpg` which did not behave as the help seemed to indicate. From what I can tell, when the command
copy “foo %bar.jpg” newfile.jpg
executed, the back quotes were remove and the copy command was looking for the files
foo and %bar
After trying different variations what seemed to work was
copy `“foo %bar.jpg”` newfile.jpg
With this form, it seems that the back quote stops %bar to be evaluated and the quotes protect the blank in the file name — is this the best way to do this? Thanks
I was scanning old hard drives for jpg’s that I might have missed along the way moving to new system and came up with a list of files. When I looked at the list, each file was annotated with its full path, and for the most part, many of the files contained blanks in the name. At first I simply just quoted (“) all the files, but I found that I missed some of the files in the list — as it turns out some of the files also contained a the trigger % so there were files like
“foo %bar.jpg”
were not found via the copy command, so checking with the help, what I need to use was the back quote (`) so then when with
`foo %bar.jpg` which did not behave as the help seemed to indicate. From what I can tell, when the command
copy “foo %bar.jpg” newfile.jpg
executed, the back quotes were remove and the copy command was looking for the files
foo and %bar
After trying different variations what seemed to work was
copy `“foo %bar.jpg”` newfile.jpg
With this form, it seems that the back quote stops %bar to be evaluated and the quotes protect the blank in the file name — is this the best way to do this? Thanks