Adds .misc_function.sh to project

This commit is contained in:
William Carroll 2016-07-07 23:21:16 -04:00
parent 16f03771d4
commit 9d8ca32658

13
.misc_functions.sh Normal file
View file

@ -0,0 +1,13 @@
# download files to /tmp directory
function wdownload {
URL="$1"
FILENAME="$(basename $URL)"
wget -O /tmp/"$FILENAME" $URL >/dev/null && open /tmp && echo "Downloaded to: /tmp/$FILENAME" || echo "Error ..."
}
# spell checker
function wspcheck {
if [ $# -ge 1 -a -f "$1" ] && input="$1" || input="-"
cat "$input" | tr '[:upper:]' '[:lower:]' | tr -cd '[:alpha:]_ \n' | tr -s ' ' '\n' | sort | comm -23 - ~/english_words.txt
}