Created
June 8, 2012 09:09
-
-
Save Wolfr/2894637 to your computer and use it in GitHub Desktop.
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
NUMBERING: | |
# number each line of a file (simple left alignment). Using a tab (see | |
# note on '\t' at end of file) instead of space will preserve margins. | |
sed = filename | sed 'N;s/\n/\t/' | |
# number each line of a file (number on left, right-aligned) | |
sed = filename | sed 'N; s/^/ /; s/ *\(.\{6,\}\)\n/\1 /' | |
# number each line of file, but only print numbers if line is not blank | |
sed '/./=' filename | sed '/./N; s/\n/ /' | |
# count lines (emulates "wc -l") | |
sed -n '$=' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment