Created
December 18, 2013 14:36
-
-
Save miglen/8023341 to your computer and use it in GitHub Desktop.
Multi tail script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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