From 64fe2474da01067db2aace222d0ae8b44fbd7edb Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 28 Oct 2022 07:22:31 +0100 Subject: [PATCH] Better gnu util handling Signed-off-by: Marcus Noble --- home/.bin/date | 1 + home/.bin/readlink | 1 + home/.bin/sed | 1 + home/.dotfiles/aliases | 12 ++++++++---- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 120000 home/.bin/date create mode 120000 home/.bin/readlink create mode 120000 home/.bin/sed diff --git a/home/.bin/date b/home/.bin/date new file mode 120000 index 0000000..9104b97 --- /dev/null +++ b/home/.bin/date @@ -0,0 +1 @@ +/opt/homebrew/bin//gdate \ No newline at end of file diff --git a/home/.bin/readlink b/home/.bin/readlink new file mode 120000 index 0000000..b0f307b --- /dev/null +++ b/home/.bin/readlink @@ -0,0 +1 @@ +/opt/homebrew/bin//greadlink \ No newline at end of file diff --git a/home/.bin/sed b/home/.bin/sed new file mode 120000 index 0000000..940fe5e --- /dev/null +++ b/home/.bin/sed @@ -0,0 +1 @@ +/opt/homebrew/bin//gsed \ No newline at end of file diff --git a/home/.dotfiles/aliases b/home/.dotfiles/aliases index a37acb9..9b47bd4 100644 --- a/home/.dotfiles/aliases +++ b/home/.dotfiles/aliases @@ -10,8 +10,9 @@ alias _find=`which find` alias _top=`which top` alias _ps="/bin/ps" alias _dig=`which dig` -alias _readlink=`which readlink` -alias _sed=`which sed` +alias _readlink=`/usr/bin/readlink` +alias _sed=`/usr/bin/sed` +alias _date=`/bin/date` alias _git=`which git` if command -v $(brew --prefix)/bin/git &>/dev/null; then alias _git=$(brew --prefix)/bin/git @@ -36,8 +37,11 @@ alias kctx='switch' alias machine-info='macchina -t Boron --bar' alias watch='watch ' alias tmp='cd $(mktemp -d)' -alias sed='gsed' -which greadlink &>/dev/null && alias readlink=`which greadlink` + +# Ensure GNU version of tools are used by default (symlink so they are picked up in scripts also) +which greadlink &>/dev/null && ln -sfn `which greadlink` ~/.bin/readlink +which gsed &>/dev/null && ln -sfn `which gsed` ~/.bin/sed +which gdate &>/dev/null && ln -sfn `which gdate` ~/.bin/date lt() { DEPTH=$(echo $1 | grep "^[0-9]*$")