-
-
Save refi64/7c8a2a65552108c76b7c to your computer and use it in GitHub Desktop.
Hy line number solver
This file contains 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 | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "usage: $0 <file> <line>" | |
exit 1 | |
fi | |
line=`expr $2 - \( $2 / 256 \* 256 \) + \( $(wc -l < $1) / 256 \* 256 \)` | |
echo "$line: `sed ${line}q\;d $1 | sed 's/^[ \t]*//;s/[ \t]*$//'`" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment