The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing the nawk variables to the shell prav076 Shell Programming and Scripting 1 04-06-2009 04:23 AM
Passing Shell Variables in ISQL dikki Shell Programming and Scripting 0 03-12-2009 01:15 AM
passing two variables into a shell script? Bashar Shell Programming and Scripting 2 05-15-2007 11:00 AM
Passing variables to sql from batch shell in linux rama71 Linux 2 06-28-2005 04:38 PM
Passing shell variables to awk program.. Vishnu Shell Programming and Scripting 1 07-17-2004 11:04 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-28-2009
lopus lopus is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 2
Wink 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!


Code:
#!/bin/sh
echo -n "Alert number:"
read alert

rsh rhost_name  'egrep $alert /opt/var/log/*.logs'


Last edited by lopus; 09-28-2009 at 08:08 PM..
  #2 (permalink)  
Old 09-28-2009
pen pen is offline
Registered User
  
 

Join Date: Apr 2009
Location: Helsinki, Finland
Posts: 31
Quote:
Originally Posted by lopus View Post
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!


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

Last edited by pen; 09-28-2009 at 08:28 PM.. Reason: minor clarification
  #3 (permalink)  
Old 09-29-2009
lopus lopus is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 2
Issue resolved

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

Bookmarks

Tags
rsh, shell script unix run, solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0