Calling expect from shell script which inturn call python
Hi Team,
I have to execute a task from my local machine, where i keep my .expect,.sh, .bash and .python scripts .Task are coded in the script and has to be executed at remote machine.
for that i used following task
.....
SCRIPT 1:
.........
SCRIPT 2:
.......
SCRIPT 3:
******************************
I came to know when script 1 is executed,script 2 starts executed.Inside script2 we are using ssh and running local script on remote system.
but when script 2 has to execute script3 ,the file is in local system(pythonscript.python) is not getting executed
please can anyone tell me what is going wrong.
how to rectify it???
Last edited by DukeNuke2; 04-25-2015 at 03:07 PM..
I have a webpage that is in HTML and PHP. In PHP I have tried using exec, system, shell_exec and passthru functions to call an Expect Script file (temp.exp). This Expect file spawns a telnet session that uses "expect/send" commands to retrieve information from an environmental unit (not a normal... (0 Replies)
I call a EXPECT script from my perl script with machine IP and a FIle. The script logins to the machine and exports the value. The values to be exported or stored in a file.
I have close to 10 machines and I have created 10 files and pass the corresponding files in command line, Now I could like... (4 Replies)
I have a Perl script sub.pl, and i want to call another Expect script called sub.exp. The sub.exp will generate a text file called sub.txt, while the sub.pl called from a html form will display the content of sub.txt to the textarea on the html form. How do I call sub.exp from sub.pl???
... (5 Replies)
Hi there,
I need some help regarding the execution of shell script from expect as the method I am trying is giving me error. I wrote an shell program which takes two arguments to telnet to a device and saves the output in a file. Following is the script.... (0 Replies)
Hi All,
I have an Expect script which logs into Cisco switch, performs a show interface command. I want to read a file of ip addresses which will be passed to the expect script.
The script to read the file works, the expect script works on it's own but when i call the 'expect' script from the... (12 Replies)
Hi all,
This is the first time i am using expect.
I am trying to call a function with in the shell script. The function will shh to a new server and will pass the password using expect and send. I need help in calling the fuction i am getting follaowing errors...
here the script
... (8 Replies)
Hi,
Am very new to expect scripting..
Can You please suggest me how to call an expect script inside another expect script..
I tried with
spawn /usr/bin/ksh
send "expect main.exp\r"
expect $root_prompt
and
spawn /usr/bin/ksh
send "main.exp\r"
expect $root_prompt
Both... (1 Reply)
I have an expect script called remote that I want to call from inside my expect script called sudoers.push, here is the code that is causing me issues:
set REMOTE "/root/scripts/remote"
...
log_user 1
send_user "Executing remote script as $user...\n"
send_user "Command to execute is: $REMOTE... (1 Reply)
I have a bash shell script, within it i am using the below two commands . its failing right on scl enable command itself.
if i run it by itself without a shell, it works fine.
by default it is using pythin version 2.6 something. i want to use 3.4 version for that reason with in the shell... (3 Replies)
Discussion started by: cplusplus1
3 Replies
LEARN ABOUT DEBIAN
pegasus-config
PEGASUS-CONFIG(1)PEGASUS-CONFIG(1)NAME
pegasus-config - The authority for where parts of the Pegasus system exists on the filesystem. pegasus-config can be used to find libraries
such as the DAX generators.
SYNOPSIS
pegasus-config [-h] [--help] [-V] [--version] [--noeoln]
[--perl-dump] [--perl-hash] [--python-dump] [--sh-dump]
[--bin] [--conf] [--java] [--perl] [--python]
[--python-externals] [--schema] [--classpath]
[--local-site] [--full-local]
DESCRIPTION
pegasus-config is used to find locations of Pegasus system components. The tool is used internally in Pegasus and by users who need to find
paths for DAX generator libraries and schemas.
OPTIONS -h, --help
Prints help and exits.
-V, --version
Prints Pegasus version information
--perl-dump
Dumps all settings in perl format as separate variables.
--perl-hash
Dumps all settings in perl format as single perl hash.
--python-dump
Dumps all settings in python format.
--sh-dump
Dumps all settings in shell format.
--bin
Print the directory containing Pegasus binaries.
--conf
Print the directory containing configuration files.
--java
Print the directory containing the jars.
--perl
Print the directory to include into your PERL5LIB.
--python
Print the directory to include into your PYTHONLIB.
--python-externals
Print the directory to the external Python libraries.
--schema
Print the directory containing schemas.
--classpath
Builds a classpath containing the Pegasus jars.
--noeoln
Do not produce a end-of-line after output. This is useful when being called from non-shell backticks in scripts. However, order is
important for this option: If you intend to use it, specify it first.
--local-site [d]
Create a site catalog entry for site "local". This is only an XML snippet without root element nor XML headers. The optional argument
"d" points to the mount point to use. If not specified, defaults to the user's $HOME directory.
--full-local [d]
Create a complete site catalog with only site "local". The an XML snippet without root element nor XML headers. The optional argument
"d" points to the mount point to use. If not specified, defaults to the user's $HOME directory.
EXAMPLE
To set the PYTHONPATH variable in your shell for using the Python DAX API:
export PYTHONPATH=`pegasus-config --python`
To set the same path inside Python:
config = subprocess.Popen("pegasus-config --python-dump", stdout=subprocess.PIPE, shell=True).communicate()[0]
exec config
To set the PERL5LIB variable in your shell for using the Perl DAX API:
export PERL5LIB=`pegasus-config --perl`
To set the same path inside Perl:
eval `pegasus-config --perl-dump`;
die("Unable to eval pegasus-config output: $@") if $@;
will set variables a number of lexically local-scoped my variables with prefix "pegasus_" and expand Perl's search path for this script.
Alternatively, you can fail early and collect all Pegasus-related variables into a single global %pegasus variable for convenience:
BEGIN {
eval `pegasus-config --perl-hash`;
die("Unable to eval pegasus-config output: $@") if $@;
}
AUTHOR
Pegasus Team http://pegasus.isi.edu
05/24/2012 PEGASUS-CONFIG(1)