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:
cat shell_check.sh
read value
if [ $value -eq 1]
then
expect sshscriptABC.expect
else
expect sshscript123.expect
fi
SCRIPT 1:-
Note the space after '1' in the square brackets...
read value
if [ $value -eq 1 ]
then
expect sshscriptABC.expect
else
expect sshscript123.expect
fi
SCRIPT 3
if [ "$uname" = "linux" ]
then
python pythonscrip.py
else
echo "fail"
fi
You can't expect the ./pythonscrip.python to be started without the interpreter running or having a shebang referencing python, this assumes Python is in the PATH.
Also python scripts end in '.py' not '.python'; research the extension '.pyc'...
Lastly the python script should match either PRE Python version 3.x.x OR POST Python version 3.x.x or else again it will not do as expected.
I can't help with the expect script as I know no expect...
You are assuming that the last shell script is being executed. Let's assume that it is......
......then the __partial__ shell script that executes a python script needs uname to work.
Somewhere in this script you have a variable with the same name as the command - not a good idea - and you are assuming the variable '$uname' returns 'linux'. This may or may not be true in all linux flavour cases.
If it is not true then the python script will not be executed.
If it is true and the python script still does not execute then an error report will ensue.
It might br a good idea to capture this error report to a file and act upon it...