Problem with "&"

Dear ALL,

I wrote a c++ program which accepts username and passwd.
I executed the binary from linux terminal as follows

#verifypwd support supp&123
[1] 26097
ksh: 123: not found

verfiypwd ---> program name
support,supp&123 ----> inputs to the program. Username and PAsswd respectively.
When I give a password with '&' it truncates any characters after that and gives the above result.
What I understand is when a & is encountered it treats it to execute as a foreground process and the rest are reported as unidentified.

Could you please suggest how i can input the string with '&'.
One option is to give the passwd string within "". Is there any way other than this.

Regards
Viji R
You need to escape special characters: \&
Topic archived. No new replies allowed.