[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Net::SSH::Perl Alternative Solution



Tony Simons wrote:
Even though I don't really like the idea of using a password in a script
I've decided to work with an alternative that works as well...may even
be a shorter script. Net::SSH::Expect

Jay, I have a question for you if you have the time.
Lets say I have some variables in a script that I want to dump out to
the serial number file.  I'm having troubles with the "" part and
writing that to the file.  Ideas?

Example
SERIALNUMBER="asdf123123123"


Use the \ to escape the embedded quotes.

printf "SERIALNUMBER=\"asdf123123123\"";

...or use single quotes -- ' -- to keep all internal quotes from being seen.

printf 'SERIALNUMBER="asdf123123123"';

Dan

--
- - - -
"Wait for that wisest of all counselors, time." -- Pericles "I do not
fear computers, I fear the lack of them." -- Isaac Asimov