SHARE
TWEET

http://unix.stackexchange.com/a/204619/88357

a guest May 20th, 2015 664 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. trap 'kill %1; kill %2' SIGINT
  4.  
  5. command1 | tee 1.log | sed -e 's/^/[Command1] /' &
  6. command2 | tee 2.log | sed -e 's/^/[Command2] /' &
  7. command3 | tee 3.log | sed -e 's/^/[Command3] /'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top