Created
July 24, 2018 09:32
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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