Last active
December 23, 2015 00:09
-
-
Save robjwells/6551907 to your computer and use it in GitHub Desktop.
Super cat: cat files to the terminal with filename headers and line numbering
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/bash | |
if [ $# -eq 0 ]; then | |
echo 'usage: scat FILE [...]' | |
fi | |
for arg in "$@"; do | |
echo "===> $arg:" | |
cat -n "$arg" | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment