Skip to content

Instantly share code, notes, and snippets.

@rothgar
Created June 28, 2016 14:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rothgar/3139efa952a984d01233f6ea5be64ecb to your computer and use it in GitHub Desktop.
Save rothgar/3139efa952a984d01233f6ea5be64ecb to your computer and use it in GitHub Desktop.
incognito shell function
#!/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