Quantcast
Channel: bash: how to pass password containing special characters - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by chepner for bash: how to pass password containing special characters

$
0
0

Just quote the parameter.

mypassword='password&123'java -jar client.jar -p username "$mypassword" file.gz

The quotes are only there to keep the shell from performing any further processing of the value of mypassword after the parameter is expanded. You don't actually pass quotes to your program.


Viewing all articles
Browse latest Browse all 2

Trending Articles