bash - ssh script doesn't return control to the parent script -


i trying execute local script on remote server, writing standard input of ssh command. script runs fine, ssh doesn't exit: hangs, , control doesn't return parent script.

parent shell :

for hostname in ${hosts} ;     ssh -t -t $hostname "bash -s" < ~backup_conf.sh  done 

called script:

#!/bin/sh     agent_base_path=/home/lokesh  if [ -d "$agent_base_path/ci/de_deployment/conf" ];          if [ -d "$agent_base_path/ci/temp/conf_bkup" ];              rm -rf $agent_base_path/ci/temp/conf_bkup         fi           cp -r $agent_base_path/ci/de_deployment/conf $agent_base_path/ci/temp/conf_bkup fi exit 

i have written 'exit' control not returning parent script. hangs @ remote server.... :(

culprit bash -s line in calling code, still expecting input ended using ctrl-c:

try instead:

for hostname in ${hosts} ;     ssh -t -t $hostname "bash ~backup_conf.sh" done 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -