Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

& being parsed in command argument

From: Stephen Lawrence Jr. <slawrence(at)ucdavis.edu>
Date: Wed May 21 2003 - 16:15:29 EDT


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

Do you need help?X

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
Received on Wed May 21 19:22:14 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:59 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library