Skip to content

Instantly share code, notes, and snippets.

@kikislater
Forked from haisum/script.sh
Last active January 22, 2020 06:47
Show Gist options
  • Save kikislater/e048a1aeb2de871578c68ce8016b28bc to your computer and use it in GitHub Desktop.
Save kikislater/e048a1aeb2de871578c68ce8016b28bc 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.bak '/argtypes/s/^/#/' file #comment and backup
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