Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active April 2, 2023 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacr/cacd449dfab2bda03ac5ba0d6496b651 to your computer and use it in GitHub Desktop.
Save dacr/cacd449dfab2bda03ac5ba0d6496b651 to your computer and use it in GitHub Desktop.
bash cheat sheet / published by https://github.com/dacr/code-examples-manager #e7fa44e1-466f-4add-8c37-1b29e98a99e4/a3e77c1171bad702bb6f13db65b225f438f7d7dd

bash cheat sheet

Get running script current directory

CURR=$(dirname "$0")
CURR=$(dirname $(readlink -f $0))

Read a password

read -s -p "password:" MYPASS

Leave nothing in the bash history

unset HISTFILE
export HISTFILE=/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment