-
-
Save liuliqiang/ef2633e2ed466d9bc6ebeb4c7a9803c8 to your computer and use it in GitHub Desktop.
comment and uncomment lines in bash script via sed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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