Passing shell variables to a rsh command

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! :confused:

#!/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

Thanks Pen, I need to brush up in script quoting. :b: