LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Bash Script and the '&' (https://www.linuxquestions.org/questions/linux-software-2/bash-script-and-the-and-645848/)

cmfarley19 05-30-2008 09:56 AM

Bash Script and the '&'
 
Hi All,
I should know this but am drawing a complete blank.
I have a simple script that I want to run to automatically log our server into or network and firewall.
The firewall log in script look like this:
Code:

#! /bin/bash

lynx -dump -auth=username:password&03 www.google.com

The password is "password&03". We have to change our passwords every 90 days and the new password must be different than our last 24. Yes, our last 24. So I just use the same password and increment a number at the end.
Anyway...
That script chokes on the '&' in my password. I can not figure out how to properly escape that character so bash will pass the full password to the script.

Any thoughts?

Chris

acid_kewpie 05-30-2008 10:21 AM

\& will do it. or put it all in single quotes.


All times are GMT -5. The time now is 05:10 PM.