Skip to content

Instantly share code, notes, and snippets.

@robjwells
Last active December 23, 2015 00:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robjwells/6551907 to your computer and use it in GitHub Desktop.
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
#!/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