Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 157

Passing parameters by shell script file to expect script

$
0
0

I need to pass a paramter from a shell script under command line of ssh script

for example :

#!/usr/bin/expectspawn ssh user@servername.com "cm1+passingparameters.sh;cmd2"

my existing script 123.sh which is working fine.

#!/usr/bin/expectspawn ssh user@servername.com "/pstools/85419/jre/bin/java -Xms1024M -Xmx1024M -Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2 -jar /app1/non/psoft/85419/gu1/gust/classes/SVC_TestS.jar https://decorp6-- tst4.custhelp.com/services/rest/connect/v1.3/incidents userid password ssow.proxy.com port;cd /app01/nonhr/psoft/85419/gucq1/gecust;mail -s 'OTO' email@ged.com < logs.txt"expect "password"send "mypassword\r"interactexpect eof

I want 2 scripts a.sh and b.sh

a.sh should be as follows (notice change from above mentioned original script PASS b.sh after .jar)

#!/usr/bin/expectspawn ssh user@servername.com "/pstools/85419/jre/bin/java -Xms1024M -Xmx1024M -Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2 -jar /app1/non/psoft/85419/gu1/gust/classes/SVC_TestS.jar PASS b.sh;cd /app01/nonhr/psoft/85419/gucq1/gecust;mail -s 'OTO' email@ged.com < logs.txt"expect "password"send "mypassword\r"interactexpect eof

b.sh should be as follows

#!/user/ksh https://decorp6--tst4.custhelp.com/services/rest/connect/v1.3/incidents userid password ssow.proxy.com port

Viewing all articles
Browse latest Browse all 157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>