Sponsored Content
Top Forums Shell Programming and Scripting running command remotely to populate local variable Post 302260004 by System Shock on Wednesday 19th of November 2008 12:45:08 PM
Old 11-19-2008
Use proper korn shell command substitution in the script.
Code:
# cat script
     #!/usr/bin/ksh
     result=$(ssh remote-client 'du -sk /usr/platform/`uname -i`')
     echo $result

# ./script
448 /usr/platform/FJSV,GPUZC-M
#


Last edited by System Shock; 11-20-2008 at 10:59 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

populate variable from remote result

Hi there i am trying to pass the result of a remote command into a variable into my script ie #!/bin/sh var = `ssh remote_box 'uname'` echo $var but all i get back is ./script.sh: var: not found However when i add a -x to put it into diag mode i get the following + ssh... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

2. UNIX for Advanced & Expert Users

mount CD from local laptop to UNIX server remotely

I need some help in emergency. I want to add some software package from Solaris 10 CD remotely to UNIX Sparc machine. I can remotely access into the machine. Question is: how do I insert Solaris 10 CD in my laptop, then mount to UNIX machine remotely and add software package. Please give me the... (7 Replies)
Discussion started by: duke0001
7 Replies

3. Shell Programming and Scripting

remotely call function from local script

The following code doesn't work properly which means it doesn't displays remote output. #!/bin/ksh #################### Function macAddressFinder ######################## macAddressFinder() { `ifconfig -a > ipInterfaces` `cat ipInterfaces` }... (2 Replies)
Discussion started by: presul
2 Replies

4. Shell Programming and Scripting

PHP populate variable with function

Hi, I've a php scirpt that calls in an external class. The external class, myClass, has several public and private functions. There is one public function which derives a value that I want be able to bring it to the main php scirpt. Here is the code. ....snip.... include... (1 Reply)
Discussion started by: nitin
1 Replies

5. Solaris

Can i bind to a local login terminal running using rsh or remotely

Hi Can i ask? I had multiple solaris workstation running and some local users using it. Is it possible to bind to the local user terminal or console he's using as if like the user well type and I can see it and what my typing in the local user see it also. Is it possible.. Thanks. (3 Replies)
Discussion started by: jao_madn
3 Replies

6. Shell Programming and Scripting

populate a bash variable from an awk operation

Hi, I'm trying to populate bash script variable, data_size with the size of the largest file in my current directory data_size=$(ls -lS | grep -v "total" | head -1) | awk '{ print $5 }' I've tried adding an echo before the call to awk data_size=$(ls -l | grep -v "total" | head -1) |... (2 Replies)
Discussion started by: mark_s_g
2 Replies

7. Shell Programming and Scripting

Running local script remotely with arguments in ksh

When i use ssh command to execute local script on remote server , I am unable to do it. Please let me know how this can be done in ksh req=abc dte=ghd ssh username@hostname "$req $dte" < run_script.sh (2 Replies)
Discussion started by: lalitpct
2 Replies

8. Red Hat

Can C program put message to IBM MQ remotely, if local server doesn't have MQ library?

Can somebody know if it is possible to connect to remote IBM MQ, if local server using C, but don't have MQ library? Thanks for contribution (0 Replies)
Discussion started by: digioleg54
0 Replies

9. UNIX for Beginners Questions & Answers

Running local script remotely with arguments

Dear Experts, I have found this script on internet that can be used to execute local script remotely #!/bin/bash # runremote.sh # usage: runremote.sh localscript remoteuser remotehost arg1 arg2 ... realscript=$1 user=$2 host=$3 shift 3 # escape the arguments declare -a args ... (4 Replies)
Discussion started by: mukulverma2408
4 Replies
installboot(1M) 														   installboot(1M)

NAME
installboot - install bootblocks in a disk partition SYNOPSIS
installboot bootblk raw-disk-device The boot(1M) program, ufsboot, is loaded from disk by the bootblock program which resides in the boot area of a disk partition. The ufs boot objects are platform-dependent, and reside in the /usr/platform/platform-name/lib/fs/ufs directory. The platform name can be found using the -i option of uname(1). The installboot utility is a SPARC only program. It is not supported on the architecture. users should use installgrub(1M) instead. bootblk The name of the bootblock code. raw-disk-device The name of the disk device onto which the bootblock code is to be installed; it must be a character device which is read- able and writable. Naming conventions for a SCSI or IPI drive are c?t?d?s? and c?d?s? for an IDE drive. Example 1: Installing UFS Boot Block To install a ufs boot block on slice 0 of target 0 on controller 1 of the platform where the command is being run, use: example# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d0s0 /usr/platform/platform-name/lib/fs/ufs directory where ufs boot objects reside. /platform/platform-name/ufsboot second level program to boot from a disk or CD See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ od(1), uname(1), boot(1M), init(1M), kadb(1M), kernel(1M), monitor(1M), reboot(1M), rpc.bootparamd(1M), init.d(4), attributes(5) WARNINGS
The installboot utility fails if the bootblk or openfirmware files do not exist or if the raw disk device is not a character device. 11 Apr 2005 installboot(1M)
All times are GMT -4. The time now is 03:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy