lopus
September 28, 2009, 7:01pm
1
I noticed my script is not passing the value of variable alert to the rsh command. I need some assistance, please. This is a solaris environement. Thanks!
#!/bin/sh
echo -n "Alert number:"
read alert
rsh rhost_name 'egrep $alert /opt/var/log/*.logs'
pen
September 28, 2009, 7:20pm
2
lopus:
I noticed my script is not passing the value of variable alert to the rsh command. I need some assistance, please. This is a solaris environement. Thanks!
#!/bin/sh
echo -n "Alert number:"
read alert
rsh rhost_name 'egrep $alert /opt/var/log/*.logs'
Hi!
You need to replace the single quotes with double ones, ie. ' => ". Otherwise the alert variable won't get expanded properly.
pen
lopus
September 29, 2009, 6:48pm
3
Thanks Pen, I need to brush up in script quoting.