Skip to content

Instantly share code, notes, and snippets.

@usual-tools
Created February 18, 2014 02:32
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 usual-tools/9063588 to your computer and use it in GitHub Desktop.
Save usual-tools/9063588 to your computer and use it in GitHub Desktop.
# 改行コードを調べる (ファイルの先頭3行が表示)
cat -e try/layout/index.html | head -3
# 結果。
# 行末が $ であれば LF
# 行末が ^M$ であれば CRLF
# 行末が ^M であれば CR
# 改行コードを LF に変換する
nkf -Lu --overwrite try/layout/index.html
# 改行コードを CR+LF に変換する
nkf -Lw --overwrite try/layout/index.html
# 改行コードを CR に変換する
nkf -Lm --overwrite try/layout/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment