I have a command
path/to/forticlientsslvpn_cli --server <host>:<port> --vpnuser testpass\101
When I run the script, linux puts a space between testpass and 101. I want the script to see "testpass\101" as the username
I hope I make sense
I have a command
path/to/forticlientsslvpn_cli --server <host>:<port> --vpnuser testpass\101
When I run the script, linux puts a space between testpass and 101. I want the script to see "testpass\101" as the username
I hope I make sense
This is happening because \ is an escape character.
Either use quoting
path/to/forticlientsslvpn_cli --server <host>:<port> --vpnuser 'testpass\101'
or use an escaped backslash:
path/to/forticlientsslvpn_cli --server <host>:<port> --vpnuser testpass\\101
For completeness, with the bash shell and on ASCII based systems, with quoting alone:
'testpass\101' (by far the best)testpass\\101"testpass\101" or "testpass\\101" (latter better)$'testpass\\101'$'testpass\u005c101' or $'testpass\U0000005c101' (U+005C being the Unicode code point for backslash)$'testpass\x5c101' (where 0x5C is the byte value of the ASCII encoding of \)$'testpass\134101' (same in octal)For more details, see How to use a special character as a normal one?
'\\'or"\\\\". – ilkkachu May 05 '20 at 11:25\add an space? I'm having trouble understand it, I think it's the same astestpass'1'01, where does the space come from? – dedowsdi May 05 '20 at 12:09testpass\101is the same astestpass101. – ilkkachu May 05 '20 at 12:37