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

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -