Created
April 17, 2014 01:29
-
-
Save stuntgoat/10946949 to your computer and use it in GitHub Desktop.
get a single line by line number from a file with bash
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
function getl() { | |
if [ "$1" -a "$2" ] | |
then | |
tail -n+"$1" "$2" | head -n1 | |
else | |
echo "Usage: getl " | |
fi | |
} | |
as seen on: | |
http://stackoverflow.com/questions/6022384/bash-tool-to-get-nth-line-from-a-file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment