Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Handling files with embedded spaces

Jul
320
3
I've seen this topic before but not sure if its a bug or you have to add "" to cover these types of files.

Eg Should say
for %in in (*.dll) do echo %in %@SHA1[%in]
work for all files or do you have to use
for %in in (*.dll) do echo %in %@SHA1["%in"]
to catch files with spaces. At the moment you have to use the latter otherwise you get a -1 value.
 
You have to double quote the argument.

Originally, I tried to automatically double quote those types of args, but got too many complaints from users who weren't expecting them. The eventual consensus was that it would be the user's responsibility, so that they expected the quotes and made provisions to handle them appropriately.

There were also concerns (with FOR) regarding CMD compatibility, which does not double quote the argument.
 

Similar threads

Back
Top