Sponsored Content
Full Discussion: ssh commands in ksh question
Top Forums Shell Programming and Scripting ssh commands in ksh question Post 302171946 by xavier054 on Saturday 1st of March 2008 07:32:32 AM
Old 03-01-2008
Another solution

Quote:
Originally Posted by pdtak
Is there a way to shorten these commands? because this script asks for a password 3 times

scp -p /usr/local/bin/${script_name} ${servername$iy]}://usr/local/bin/
ssh ${servernames[$iy]} /usr/local/bin/${script_name}
ssh ${servernames[$iy]} rm -f /usr/local/bin/${script_name}

Basically, I'm creating a script within a script, pushing it out to a server, execute it, and then removing it.

Thanks in advance.
To execute a simple script (that would execute ls -l / for example), my ideao would be to use the standard input :

echo "ls -l /" | ssh host "cat > /tmp/tmpscript && chmod +x /tmp/tmpscript && /tmp/tmpscript && rm /tmp/tmpscript"

Hope this can help...

X.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh GUI commands

I have a few scripts that i would like to make into GUI's. Are there scripting commands to make GUI's if so where can i get the list of commands and what they do or if anyone has an example of it. Anything will help, thanks (1 Reply)
Discussion started by: daltonkf
1 Replies

2. UNIX for Dummies Questions & Answers

ksh substring commands

I am trying to get various portions of strings in my script, but am getting a substitution error. I followed the syntax that was described when I goggled this, but I can't get anything to work. #! /bin/ksh/ hello="adklafk;afak" #hello=${hello:3} hello=${$hello:3} happy="hey" echo... (1 Reply)
Discussion started by: anderssl
1 Replies

3. Shell Programming and Scripting

ssh and commands

can someone point me to where it explains how to set the right commands wd ssh? cat something | while read h; do awk 'BEGIN {FS="\n"; RS=""; ORS="\n\n"} {if ($0~/'$h'/) print hdrvar,"\n",$0 }' /something/somedata ; done above works in when ssh'ing into linux machine invoke like this ssh... (10 Replies)
Discussion started by: convenientstore
10 Replies

4. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

5. UNIX for Advanced & Expert Users

Better KSH commands

Are there any documents available for checking the execution time taken by ksh commands? My requirement is to fine tune a set of shell scripts having lot of "echos" and "date"s. Is there a better replacement for the below code?. echo "ABC process started on `date`" some code.. echo... (12 Replies)
Discussion started by: engineer
12 Replies

6. Shell Programming and Scripting

Bash commands to an 'ssh' within an ssh'

I've struggled to find a solution to this problem from searching so I thought I'd write a post to see what can be done. I'm attempting to connect and run commands on 'server2' but because of security limitations I cannot access it directly. I can however ssh into 'server1' and then into... (7 Replies)
Discussion started by: mcintosh.jamie
7 Replies

7. UNIX for Dummies Questions & Answers

Calling commands with ksh

Hi, I am not able to run below command on linux, it however works on solaris. If anyone knows the reason and a solution for it can you please let me know ? Linux ----- $> ksh 'echo hi' ksh: echo hi: No such file or directory $> which ksh /usr/bin/ksh Solaris ------ $> ksh 'echo... (2 Replies)
Discussion started by: krishnaux
2 Replies

8. Shell Programming and Scripting

SED sub commands in KSH not working for me

I am using SED to edit a file (called file) the file contains the word "ERROR" and I want to use SED to: 1. Search for text "ERROR" If found, 2. Append new line with text "hoi" I tried: sed 's/ERROR/ a\hoi' file sed 's/ERROR/ a\ hoi' file I get all the time the error sed:... (7 Replies)
Discussion started by: Alex400
7 Replies

9. Shell Programming and Scripting

Sequential execution of commands in ksh

I need to run few commands in a ksh script sequentially. Some of the commands are jobs submitted to the server and the consecutive commands are dependent on the completion of the jobs submitted to the server. It works if i separate the commands into different files like this #!/bin/ksh... (1 Reply)
Discussion started by: prashob123
1 Replies

10. UNIX for Dummies Questions & Answers

ksh with Oracle commands

works fine. echo "Deleting CHOPOne Coreaccess from LAUA..." $ORACLE_HOME/bin/sqlplus username/password@servername << ! delete from usergrpdtl where username='acker'; commit; ! but not working with "if statement" even $TMPDIR/adlogin.log exists and greater than 0. if then ... (9 Replies)
Discussion started by: lawsongeek
9 Replies
PLOT(1G)																  PLOT(1G)

NAME
plot - graphics filters SYNOPSIS
plot [ -Tterminal [ raster ] ] DESCRIPTION
These commands read plotting instructions (see plot(5)) from the standard input, and in general produce plotting instructions suitable for a particular terminal on the standard output. If no terminal type is specified, the environment parameter $TERM (see environ(5)) is used. Known terminals are: 4014 Tektronix 4014 storage scope. 450 DASI Hyterm 450 terminal (Diablo mechanism). 300 DASI 300 or GSI terminal (Diablo mechanism). 300S DASI 300S terminal (Diablo mechanism). ver Versatec D1200A printer-plotter. This version of plot places a scan-converted image in `/usr/tmp/raster' and sends the result directly to the plotter device rather than to the standard output. The optional argument causes a previously scan-converted file raster to be sent to the plotter. FILES
/usr/bin/tek /usr/bin/t450 /usr/bin/t300 /usr/bin/t300s /usr/bin/vplot /usr/tmp/raster SEE ALSO
plot(3), plot(5) BUGS
There is no lockout protection for /usr/tmp/raster. PLOT(1G)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy