Bash trap exit kill last process -
i have following in bash file: (i kill web server once bash script on under circumstances)
python -m simplehttpserver 12345 & trap "kill $!" exit
i wondering how safe/widespread this? when $!
evaluated (i pretty sure happens @ place of declaration, still need advice)?
what wrote safe. because you're using double quotes, $!
evaluated immediately. if used single quotes evaluated @ time script exits.
Comments
Post a Comment