Skip to content

Instantly share code, notes, and snippets.

@ruseel
Created December 16, 2013 07:10
Show Gist options
  • Save ruseel/7983384 to your computer and use it in GitHub Desktop.
Save ruseel/7983384 to your computer and use it in GitHub Desktop.
trailing space를 CR, LF를 그대로 두고 제거한다. 그리고 sed로 CR까지 제거한다.
# ruby
removed = all.gsub /[\x20\t]+(\r)*$/, '\1'
# sed - CR을 제거한다. 짐작에 $가 LF만 매치되고 \s에 CR이 매치되는 듯 싶다.
sed -ri 's/\s+$//g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment