Skip to content

Instantly share code, notes, and snippets.

@luisadha
Created October 23, 2022 08:31
Show Gist options
  • Save luisadha/5ad713f66919364169a86814e5a1660d to your computer and use it in GitHub Desktop.
Save luisadha/5ad713f66919364169a86814e5a1660d to your computer and use it in GitHub Desktop.
Cu is a function referring to gnu coreutils for easier and more efficient use.
[ -z "$PS1" ] && return # bashcheck is only called via function
cu()
{
local program="$1"
local help="$*";
if [ -z "$program" ]; then echo "cu: Try \`cu --help' "; exit 1
elif [ "$program" == "--help" ]; then coreutils --help;
elif [ "$program" == "--version" ]; then coreutils --version;
else eval cmd=--coreutils-prog=$1; coreutils $cmd $help; fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment