I have to two scripts, I want to execute on a server. The problem is, that the frist script sets some environment variables and has to be executed via
. script1.ksh
while the second can be executed just by
script2.ksh
Now if I give Jsch the following String to execute
cd work_dir && . script1.ksh && ./script2.ksh
It tells me script1.ksh not found Whil if I try
cd work_dir && ./script1.ksh && ./script2.ksh
of course the variables in script2 are not defined.
Is there any way to execute such a command in JSch?