Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Last active October 4, 2016 11:30
Show Gist options
  • Select an option

  • Save coderofsalvation/8326356 to your computer and use it in GitHub Desktop.

Select an option

Save coderofsalvation/8326356 to your computer and use it in GitHub Desktop.
prints lines which do not exceed the terminal width
# prints lines which do not exceed the terminal width
# usage: cat somefile.txt | wraplines
function wraplines(){
cut -c1-$(stty size <&2 | cut -d' ' -f2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment