scripting - Invoke nested shell scripts from ssh -


i have 2 shell scripts; let's call script1 , script2.

within script1 invoke script2. when call script1 local terminal work fine, when launch command ssh this:

plink.exe -ssh hostname -l user -pw password "path script1/script1" 

i error:

script2 not found.

now can put absolute path inside script1 call script2, problem script2 calls other scripts , on...

can avoid ssh command root?

in script1, try if adding @ start of script helps:

cd $(dirname "$0") 

or call pushd/popd around calls script2.

pushd $(dirname "$0") relative_path_for_script2/script2 arg1 arg2 ... popd 

if while calling manually terminal, need execute script1 specific directory, /tmp, pushd directory instead.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -