Last active
September 6, 2020 07:30
-
-
Save NateWeiler/b2cec2fa25c85a7a31adb76685854be8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# your target file | |
CONFIG=./config.txt | |
# comment target | |
comment() { | |
sed -i '' "s/^$1/#$1/" $CONFIG | |
} | |
# comment target | |
uncomment() { | |
echo $1 | |
sed -i '' "s/^#$1/$1/" $CONFIG | |
} | |
# Use it so: | |
uncomment enable_uart | |
comment arm_freq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment