Skip to content

Instantly share code, notes, and snippets.

@rawiriblundell
Created July 24, 2018 09:32
Show Gist options
  • Save rawiriblundell/e59aac3b18748f7375edbee03645f4ab to your computer and use it in GitHub Desktop.
Save rawiriblundell/e59aac3b18748f7375edbee03645f4ab to your computer and use it in GitHub Desktop.
Another function that demonstrates the overlay trick of using 'command'. This adds a '--home' arg to the logname command
logname() {
case "${1}" in
(--home)
getent passwd "$(command logname)" | awk -F ':' '{print $6}'
;;
(*)
command logname "${@}"
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment