Skip to content

Instantly share code, notes, and snippets.

@jjb
Created November 4, 2012 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjb/4010040 to your computer and use it in GitHub Desktop.
Save jjb/4010040 to your computer and use it in GitHub Desktop.
commandline tools dealing with missing trailing newline
# 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
# 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