Created
November 4, 2012 03:40
-
-
Save jjb/4010040 to your computer and use it in GitHub Desktop.
commandline tools dealing with missing trailing newline
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
# diff -c 1.txt 3.txt - lack of newline is announced in output | |
*** 1.txt 2012-11-03 23:24:05.000000000 -0400 | |
--- 3.txt 2012-11-03 23:28:44.000000000 -0400 | |
*************** | |
*** 1,2 **** | |
! foo | |
bar | |
\ No newline at end of file | |
--- 1,2 ---- | |
! food | |
bar | |
\ No newline at end of file |
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
# bash - prompt is tacked onto output | |
➔ cat 1.txt | |
foo | |
bar➔ | |
# zsh - lack of newline is shown with "%" | |
➔ cat 1.txt | |
foo | |
bar% | |
➔ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment