Created
June 28, 2016 14:55
-
-
Save rothgar/3139efa952a984d01233f6ea5be64ecb to your computer and use it in GitHub Desktop.
incognito shell function
This file contains 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
#!/bin/bash | |
incognito() { | |
if [[ -z ${SHELL} ]]; then | |
echo "Could not determin shell.\nUsing /bin/bash" | |
SHELL=bash | |
fi | |
case "${SHELL}" in | |
*bash) | |
set -o history | |
;; | |
*zsh) | |
HISTFILE=/dev/null | |
;; | |
*) | |
echo "Shell not supported" | |
exit 2 | |
;; | |
esac | |
} | |
incognito |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment