make notes case-insensitive

This commit is contained in:
Neale Pickett 2011-09-20 11:08:14 -05:00
parent da716ad947
commit dc9f49e350
1 changed files with 6 additions and 1 deletions

7
notes
View File

@ -3,6 +3,11 @@
db=$1; shift
text=$1
lc () {
printf "%s" "$1" | tr A-Z a-z
}
sender=$(lc "$sender")
if [ -f $db/$sender ]; then
echo "Welcome back, $sender. Your messages:"
cat $db/$sender
@ -12,7 +17,7 @@ fi
case "$text" in
note\ *)
args=${text#note }
who=${args%% *}
who=$(lc "${args%% *}")
what=${args#* }
when=$(date)