Reputation: 99
I want pass specific parameters(aaa|bbb|ccc) but it's not working.
Here's what the command line looks like:
test.bat aaa|bbb|ccc
and test.bat looks like:
echo %1
but its not working cuz test.bat receive only 'aaa'. how can I pass whole parameter 'aaa|bbb|ccc'?
ps. I must use this format : 'aaa|bbb|ccc' there is no option to change like aaa_bbb_ccc.. etc.
Upvotes: 1
Views: 142
Reputation: 16266
The VERTICAL BAR is the pipe character to command.com and cmd.exe. If you want to use is literally, it must be escaped using a CARET.
K:>echo aaa^|bbb^|ccc
aaa|bbb|ccc
Actually, I think I might prefer the quoting suggestion as it appears to work under bash and perhaps other shells.
$ echo "aaa|bbb|ccc"
aaa|bbb|ccc
$ echo 'aaa|bbb|ccc'
aaa|bbb|ccc
Upvotes: 1
Reputation: 26
Using the "|" means you use the pipe function. http://ss64.com/nt/syntax-redirection.html
You should use "aaa|bbb|ccc" so that it will read everything between the quotation marks.
I hope it helps
Upvotes: 1