viccherubini/get-shit-done

Sed issues and duplication in /etc/hosts

Closed this issue · 2 comments

I am getting the following error when trying to go to play-mode:

[.bin]=> sudo bash get-shit-done.sh work
[.bin]=> sudo bash get-shit-done.sh work
[.bin]=> cat /etc/hosts
              ## start-gsd
              127.0.0.1 reddit.com
              127.0.0.1 www.reddit.com
              (...)
              ## end=gsd
              ## start-gsd
              127.0.0.1 reddit.com
              127.0.0.1 www.reddit.com
              (...)
              ## end=gsd
[.bin]=> sudo bash get-shit-done.sh play
sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

So there is duplicates in the /etc/hosts-file and the play-script is not working.

I made my own simpler version in Ruby which doesn't have these issues.

Feel free to get inspiration: https://github.com/kap0w/get-shit-done.rb

I reverted the shell script back to the original version.