& being parsed in command argument
From: Stephen Lawrence Jr. (slawrence_at_ucdavis.edu)
Date: 05/21/03
- Previous message: TooManyMirrors: "Re: sftp script running through crontab"
- Next in thread: Stephen Lawrence Jr.: "Re: & being parsed in command argument"
- Maybe reply: Stephen Lawrence Jr.: "Re: & being parsed in command argument"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 21 May 2003 13:15:29 -0700 To: secureshell@securityfocus.com
Hello, I have a problem with an ssh command and was hoping for some help.
The bash script I have does the following:
1) It builds a $cmdline variable out of some text and the $@ variable: ex
$@ may be set to something like this:
"RP_HEADER='Acnt GH&002, period 08, and fiscial year 2001'"
then:
cmdline='source /etc/profile;cd
'$pwd_dir';/u01/app/oracle/product/7.3.4/bin/r25runm '"$@"
2) It then calls ssh, passing it a host and $cmdline arguemt: ex.
ssh -n oracle $cmdline
This method normally works fine, but every once in a while, the $@
variable comes with an "&" in it (like the example above), and as it is
being passed to ssh, the script errors out before it gets to the remote
host because it is capturing the & as a bash signal to background.
Does anyone have any ideas on what I could do to fix this? Is is a
quoting issue with the script?
-- Stephen Lawrence Jr. - Programmer II slawrence@ucdavis.edu California Animal Health & Food Safety Laboratory System, UC Davis (530)-752-4614
- Previous message: TooManyMirrors: "Re: sftp script running through crontab"
- Next in thread: Stephen Lawrence Jr.: "Re: & being parsed in command argument"
- Maybe reply: Stephen Lawrence Jr.: "Re: & being parsed in command argument"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|