1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Handling files with embedded spaces

Discussion in 'Support' started by thorntonpg@gmail.com, Aug 12, 2016.

  1. thorntonpg@gmail.com

    Joined:
    Jul 4, 2008
    Messages:
    188
    Likes Received:
    0
    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.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,869
    Likes Received:
    83
    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.
     
    thorntonpg@gmail.com likes this.

Share This Page