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
Whats wrong with this line? looza Shell Programming and Scripting 5 07-14-2008 11:32 AM
What's wrong with this line: if ${TEST:?} ; then echo empty; fi meili100 UNIX for Dummies Questions & Answers 2 02-23-2008 11:45 AM
what am i doing wrong iago UNIX for Dummies Questions & Answers 4 09-04-2007 08:27 AM
Whats wrong with this 5 line script! c19h28O2 Shell Programming and Scripting 9 05-11-2006 02:04 AM
What was wrong ??? ksh sabercats Shell Programming and Scripting 11 02-27-2006 01:12 PM

Closed Thread
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 07-16-2008
looza looza is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 23
Arrow what is wrong with this line?

system ("$ssh '$perf_stats' < temp_pipe 2>&1 &");

I need to start and interact with my executable defined by perf_stats on a remote machine but not change my command line to that of the remote machine. temp_pipe is a node created by mknod -f temp_pipe
  #2 (permalink)  
Old 07-16-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
I assume $ssh contains the command your trying to run..

I have had problems with putting the var right in the system command.

I usually do this:

$mycommand = "somecommand";
#next line lets you verify the command is correct
print "Running Command: $cmd \n";
$cmd = "$mycommand $othervars < $whatever";

system($cmd);

or

$rtn = `$cmd`;
  #3 (permalink)  
Old 07-16-2008
looza looza is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 23
$ssh contains the command that connects the client with the remote host.
system ("$ssh '$perf_stats' < temp_pipe 2>&1 &");

I then use something like this:
system("$rsh '$cmd'" );

where $rsh is the rsh connection command and $cmd is the command I use to run on $perf_stats.
  #4 (permalink)  
Old 07-16-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
Aren't you missing the destination host names?
  #5 (permalink)  
Old 07-17-2008
looza looza is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 23
the $rsh, $ssh contains that. for instance,
$ssh="ssh $USER@$HOST";
  #6 (permalink)  
Old 07-17-2008
KevinADC KevinADC is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2008
Posts: 731
The @ symbol must be escaped in a double-quoted string unless you want perl to think it is an array and expand it into a scalar.

$ssh="ssh $USER\@$HOST";
  #7 (permalink)  
Old 07-17-2008
KevinADC KevinADC is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2008
Posts: 731
The @ symbol must be escaped in a double-quoted string unless you want perl to think it is an array and expand it into a scalar.

$ssh="ssh $USER\@$HOST";
Closed Thread

Bookmarks

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 04:48 AM.


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