The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
system not booting after running local boot scripts tcb3210 Ubuntu 0 05-30-2008 05:55 AM
mount CD from local laptop to UNIX server remotely duke0001 UNIX for Advanced & Expert Users 7 10-31-2007 04:20 PM
populate variable from remote result hcclnoodles Shell Programming and Scripting 2 02-19-2007 05:44 AM
Running an Interactive Program Remotely Terrible Shell Programming and Scripting 3 10-19-2006 11:48 PM
running commands with remotely with Telnet Terrible Shell Programming and Scripting 2 06-27-2006 04:47 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-19-2008
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
running command remotely to populate local variable

If I run this

Code:
[root@central-server] # ssh remote-server 'du -sk /usr/platform/`uname -i`/'
174     /usr/platform/SUNW,Sun-Fire-V245
I get my output just fine,

However, if i try to do the same but populate a local variable within my script called for example 'result'

Code:
#!/bin/ksh

result=`ssh remote-server 'du -sk /usr/platform/`uname -i`/'`
echo $result
I get

Code:
[root@central-server] # ./test.sh 
./test.sh[13]: /: cannot execute
./test.sh[13]: -i:  not found
It looks like the `uname -i` is not getting run remotely, does anybody know how I can get this to be recognised by the remote box ?

Any help would be great

Cheers
 

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

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 03:59 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