Created
July 6, 2012 09:54
-
-
Save eidantoei/3059311 to your computer and use it in GitHub Desktop.
余計なhostsコメントアウトして帰るやつ
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
#!/bin/bash | |
BORDER="# -------- TEMPORARY_HOSTS --------" | |
L=$(( $(fgrep -n "${BORDER}" /etc/hosts | cut -d: -f1) + 1 )) | |
sudo sed -i.$(date +%F-%H-%M-%S) "${L},\$s/^\([^#]\)/#\1/g" /etc/hosts | |
cat /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment