This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read a random word from the dictionary and try to get its definition from | |
# Merriam-Webster. | |
function word-of-the-day { | |
local file="${1:-/usr/share/dict/words}"; | |
if ! [ -r "$file" ]; then | |
echo "Cannot read from dictionary file: $file" 1>&2; | |
return 1; | |
fi; | |
local IFS=$'\n' words=($(<"$file")); | |
local num_words=${#words[@]}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ============== shell | |
# Case-insensitive globbing. | |
shopt -s nocaseglob; | |
# Do not overwrite files when redirecting using ">", ">&" or "<>". | |
# Note that you can still override this with ">|". | |
set -o noclobber; | |
# UTF-8 all the way. | |
export LC_ALL='en_GB.UTF-8'; |
NewerOlder