ããããæ¹æ³ãããã¨ãããã®ã§ããã以ä¸ã®ãããªã·ã§ã«ã¹ã¯ãªããã§ãã¾ããã®ã¯ã©ãã§ãããã? #!/bin/bash function kill_children { # jobs -l | perl -ne 'print "kill $1\n" if /^\S+?\s+(\d+)/' | sh; pkill -P $$; wait; } trap "kill_children" EXIT HOSTS="192.168.1.1 192.168.1.2" for host in $HOSTS do ssh $host tail -F /service/foo/log/main/current & done wait ã¡ãã£ã¨ç®æ¡æ¸ãã§è§£èª¬ããã¨ä»¥ä¸ã®ãããªãã¨ããããªã£ã¦ãã¾ãã & ã§ããã¯ã°ã©ã¦ã³ãã¸ã§ããã¯ããããwait ã§ãããã®çµäºãå¾ ã¤trap ã EXIT 㯠atexit
{{#tags}}- {{label}}
{{/tags}}