Skip to content

Instantly share code, notes, and snippets.

@tuklusan
Created September 15, 2016 20:35
Show Gist options
  • Save tuklusan/e0aa656a19964ee9fd1e19f344630d7c to your computer and use it in GitHub Desktop.
Save tuklusan/e0aa656a19964ee9fd1e19f344630d7c to your computer and use it in GitHub Desktop.
# /etc/profile.d/custom.sh - get a fortune-cowsay message on logging in
if [[ $(which cowsay > /dev/null ; echo $?) -eq 0 ]] && [[ $(which fortune > /dev/null ; echo $?) -eq 0 ]] ; then
cowsay -f $(ls $(cowsay -l | awk 'NR==1 {print $4}' | sed 's/://') | shuf -n1) $(fortune)
echo
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment