call another shell script and pass parameters to that shell script
Hi,
I basically have 2 shell scripts.
One is a shell script will get the variable value from the user. The variable is nothing but the IP of the remote system.
Another shell script is a script that does the job of connecting to the remote system using ssh. This uses a expect utility in turn.
Now, i want to run the first script and and get the variable value and pass that as parameter to anpother shell script, where that value is retrieved and used to connect.
Here r excerpts from 2 scripts:
-------------------------------------------------------------------------------------
script 1:
Now, please can some one help me with the prblem tat i am facing.
is there any way to achieve the above.
How can i call script 2 from script 1 along with passing parameters (IPaddr), which will be referenced in the second script.
Appreciate your help!!
Last edited by Franklin52; 11-29-2010 at 03:43 PM..
Reason: Please use code tags
You should not be using hardcoded plaintext passwords to login with ssh. They implemented measures to prevent people doing this -- which is why you had to brute-force it with expect. In other words it's a less-than-subtle hint that what you're doing is a really, really bad idea.
Google "passwordless ssh" and you'll find hundreds of examples for using keys, a safer and more secure mechanism that works automatically, no "expect" bludgeoning required.
Dear Friends,
Please help me on this
my script name is send.csh
In this i have written the statement like this
set args = ( city state country price )
I want to pass this array to another c shell called receiver.csh. and i want to use it in this c shell
or
how to pass to... (2 Replies)
I have the below script triggered daily at 330am in the morning, since last 7 days job not writing anything to database.
below impala shell calling shell file which has sql , it is extracting data and loads to a flat file txt file. which is going wrong for last 1 week.
need help, echo... (2 Replies)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Hi All,
I have new for shell scripting.
Problem : I have one scrip at serv1 and path of server is /apps/dev/provimage/scripts and script name:extract_ancillary.bat.
I need to call this script at server2(my working server) and execute at server2 .
Please let me know how to build the... (5 Replies)
Hello,
I have this awk script that I want to execute by passing parameters through a shell script.
I'm a little confused. This awk script removes duplicates from an input file.
Ok, so I have a .sh file called rem_dups.sh
#!/usr/bin/sh... (4 Replies)
Could someone help me to call a shell script with named parameters.
I mean
Callscript .sh -c someconfigfile.txt
or
callscript.sh -config someconfigfile.txt
inside the script how can I retrieve someconfigfile.txt using the parametername -c or -config.
Thanks. (2 Replies)
Hey Guys
from the below script what I understood is we are sending the the first parameter as input to the main (){} file
main > $LOGFILE 2>&1
but can we send two or three parameter as input to this main file as
main > $LOGFILE 2>&1 2>&2 like this
Can any one plz help I need to writ a... (0 Replies)
Dear Friends,
Please help me.
How can I pass a parameter from one Shell-script to another Shell-script.
Example:
FirstScript.sh
-------------
./SecondScript.sh 'paramater'
And
SecondScript.sh
---------------
doing something with passed parameter from FirstScript.sh
Please... (2 Replies)