Skip to content

Instantly share code, notes, and snippets.

@miglen
Created December 18, 2013 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miglen/8023341 to your computer and use it in GitHub Desktop.
Save miglen/8023341 to your computer and use it in GitHub Desktop.
Multi tail script
#!/bin/sh
# When this exits, exit all back ground process also.
trap 'kill $(jobs -p)' EXIT
# iterate through the each given file names,
for file in "$@"
do
# show tails of each in background.
tail -f $file &
done
# wait .. until CTRL+C
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment