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

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -