Skip to content

Instantly share code, notes, and snippets.

@liuliqiang liuliqiang/script.sh forked from haisum/script.sh
Created Dec 11, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.