Skip to content

Instantly share code, notes, and snippets.

@vinsim24
Last active September 23, 2017 18:45
Show Gist options
  • Save vinsim24/e3e2edaec18dd056652b3c31519ffae2 to your computer and use it in GitHub Desktop.
Save vinsim24/e3e2edaec18dd056652b3c31519ffae2 to your computer and use it in GitHub Desktop.
BASH-Remove Leading and Trailing spaces in a file
#!/bin/bash
cat input.txt | sed 's/^[ \t]*//;s/[ \t]*$//' > output.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment