Skip to content

Instantly share code, notes, and snippets.

@palopezv
Created September 18, 2011 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palopezv/1225568 to your computer and use it in GitHub Desktop.
Save palopezv/1225568 to your computer and use it in GitHub Desktop.
coreutils aliases on non GNU systems (bash func)
make_gnu_aliases() {
local cmd
local gcmd
for gcmd in /opt/csw/bin/g*
do
cmd=${gcmd##*/g}
if [[ "$(type -p ${cmd})" ]]; then
alias ${cmd}=$(type -p g${cmd} ${cmd} | head -1)
fi
done
}
make_gnu_aliases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment