Last active
April 28, 2019 13:38
Revisions
-
cmsj revised this gist
Jan 15, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,7 @@ # * source /path/to/homegnu.sh # 3) (optional extra) build something fancy into your $PS1 to detect $__HOMEGNU is set, to let you know commands are different now # 4) Explore other packages that have gnubin paths: grep -rl gnubin /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ # 5) To undo Homegnu, either set your $PATH back to normal, or just spawn a new shell/terminal BREWROOT="/usr/local" GNUPATH="" -
cmsj revised this gist
Jan 15, 2018 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,11 +2,17 @@ # This script will attempt to make your macOS system behave more like GNU for shell scripts # by diverting as many commands as possible, to the GNU versions, provided by Homebrew # # For most Homebrew tools, their presence in /usr/local/bin and that being in your $PATH # means you can use them as-is, but some tools appear with different names because macOS # already has such a tool (e.g. find(1)). These tools generally also have a `gnubin` path # which we can use to make them higher priority than the macOS equivalents. # # To use this: # 1) Install various GNU tools via homebrew, such as: # * coreutils # * gnu-getopt # * gnu-sed # * gawk # * gnu-tar # * gnu-time # * gnu-which @@ -15,6 +21,7 @@ # 2) Load this script into your shell when you want to Go GNU: # * source /path/to/homegnu.sh # 3) (optional extra) build something fancy into your $PS1 to detect $__HOMEGNU is set, to let you know commands are different now # 4) Explore other packages that have gnubin paths: grep -rl gnubin /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ BREWROOT="/usr/local" GNUPATH="" -
cmsj revised this gist
Jan 15, 2018 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,6 @@ BREWROOT="/usr/local" GNUPATH="" while read -r gnubin ; do GNUPATH="${gnubin}:${GNUPATH}" done < <(find -L "${BREWROOT}/opt" -type d -name gnubin) -
cmsj revised this gist
Jan 15, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #!/bin/echo Don't execute this script directly, source it into your shell. # This script will attempt to make your macOS system behave more like GNU for shell scripts # by diverting as many commands as possible, to the GNU versions, provided by Homebrew # -
cmsj created this gist
Jan 15, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/bin/bash # This script will attempt to make your macOS system behave more like GNU for shell scripts # by diverting as many commands as possible, to the GNU versions, provided by Homebrew # # To use this: # 1) Install various GNU tools via homebrew, such as: # * coreutils # * gnu-getopt # * gnu-sed # * gnu-tar # * gnu-time # * gnu-which # * moreutils # * num-utils # 2) Load this script into your shell when you want to Go GNU: # * source /path/to/homegnu.sh # 3) (optional extra) build something fancy into your $PS1 to detect $__HOMEGNU is set, to let you know commands are different now BREWROOT="/usr/local" GNUPATH="" #for gnubin in $(find -L ${BREWROOT}/opt -type d -name gnubin) ; do while read -r gnubin ; do GNUPATH="${gnubin}:${GNUPATH}" done < <(find -L "${BREWROOT}/opt" -type d -name gnubin) export PATH="${GNUPATH}${PATH}" export __HOMEGNU=1