Skip to content

Instantly share code, notes, and snippets.

@zemm
Created November 22, 2017 09:34
Show Gist options
  • Save zemm/d5118851d5fe4ce6b910b2646344fda2 to your computer and use it in GitHub Desktop.
Save zemm/d5118851d5fe4ce6b910b2646344fda2 to your computer and use it in GitHub Desktop.
Switching from atom to code
#!/bin/bash
cowstring=$(find /usr/share/cowsay -name '*.cow' -exec basename {} \; | sed 's#\.cow$##')
IFS=' ' read -r -a cowarray <<< $cowstring
cowcount=$(echo "$cowstring" | wc -w)
mycow=${cowarray[$[ ( $RANDOM % $cowcount ) + 1 ]]}
cowsay -f $mycow "Did you mean: 'code'?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment