Created
March 9, 2024 00:28
-
-
Save hellwolf/a5d40d23b1eeb83a44486db45a683a2e to your computer and use it in GitHub Desktop.
macos gnu coreutils wrappers
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
PATH=~/Applications/gnu-coreutils-wrappers/bin:$PATH |
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 | |
ORIG_BINS_DIR=$(echo /usr/local/Cellar/coreutils/*/bin) | |
BIN_NAME=$(/usr/bin/basename "$0") | |
exec $ORIG_BINS_DIR/g$BIN_NAME "$@" |
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 | |
# update gnu utils | |
ORIG_BINS_DIR=$(echo /usr/local/Cellar/coreutils/*/bin) | |
NEW_BIN_DIR=$(dirname "$0")/bin | |
rm -f "$NEW_BIN_DIR"/* | |
for i in $ORIG_BINS_DIR/g*;do | |
ln -sf ../runner.sh $NEW_BIN_DIR/${i#$ORIG_BINS_DIR/g} | |
done | |
# update gnu sed | |
ln -sf /usr/local/bin/gsed $NEW_BIN_DIR/sed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment