Skip to content

Instantly share code, notes, and snippets.

@yarkovaleksei
Forked from haisum/script.sh
Created December 6, 2017 13:40
Show Gist options
  • Save yarkovaleksei/7f258d797337a03e317f7c7fd28db42b to your computer and use it in GitHub Desktop.
Save yarkovaleksei/7f258d797337a03e317f7c7fd28db42b to your computer and use it in GitHub Desktop.
comment and uncomment lines in bash script via sed
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i '/<pattern>/s/^#//g' file #uncomment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment