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
Post a Comment