Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: [SHELL] Detect backslash in command line args

by choroba (Chancellor)
on Jul 08, 2013 at 14:17 UTC ( #1043129=note: print w/replies, xml ) Need Help??

in reply to [SHELL] Detect backslash in command line args

I am not sure about cmd.exe, but for *nix shells, it is not possible. The backslash is interpreted by the shell running the prompt, which means the script gets the string without the backslash.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: [SHELL] Detect backslash in command line args

Replies are listed 'Best First'.
Re^2: [SHELL] Detect backslash in command line args
by soonix (Prior) on Jul 08, 2013 at 17:18 UTC
    Yes, that's one of the bigger differences between the MS family and the Unix family. In Unix it's the shell's task to do command line parsing, globbing, etc. while COMMAND.COM and CMD.EXE just call the program and let it do all the rest. So, the answer to the OP: in Unixish systems, there isn't.

      You can probably demonstrate that effect with:

      echo comma\nd with backslash | cat -v

      But the shell will parse the backslash - so in one sense, you don't actually _need_ to detect it, because it isn't there any more by the time your script uses it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043129]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2017-03-25 04:10 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (310 votes). Check out past polls.