Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Created March 9, 2024 00:28
Show Gist options
  • Save hellwolf/a5d40d23b1eeb83a44486db45a683a2e to your computer and use it in GitHub Desktop.
Save hellwolf/a5d40d23b1eeb83a44486db45a683a2e to your computer and use it in GitHub Desktop.
macos gnu coreutils wrappers
PATH=~/Applications/gnu-coreutils-wrappers/bin:$PATH
#!/bin/bash
ORIG_BINS_DIR=$(echo /usr/local/Cellar/coreutils/*/bin)
BIN_NAME=$(/usr/bin/basename "$0")
exec $ORIG_BINS_DIR/g$BIN_NAME "$@"
#!/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