my dev workflow is something like this:
term-1 $ ctl-C #kills tail
term-1 $ catalina7 stop
term-2 $ ant
term-1 $ catalina jpda start && tail -f logs/catalina.out
how can i hook the ^C on tail, to run catalina stop?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can put this in a bash script and use the built-in
trapcommand like this:The first argument to
trapis a command that is to be run when the given signal (the second parameter) is received. To trap Ctrl-C you use theINTsignal. Another useful signal isEXITwhich calls the trap every time the script ends.