-
-
Save mattolenik/063cf8fd1187ea0b167e206f4dda1425 to your computer and use it in GitHub Desktop.
Use awk to uncomment specific lines of a file
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
# Strips n characters from the beginning of the line. This example uncomments a line in /etc/sudoers. | |
n=3 | |
cat /etc/sudoers | awk '/^# %wheel ALL=\(ALL\) ALL/ {$0=substr($0,$n)} 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment