From dc9f49e3507bc0f471de1b8c4ed105b2d5797cbd Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 20 Sep 2011 11:08:14 -0500 Subject: [PATCH] make notes case-insensitive --- notes | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/notes b/notes index db99ed8..4baeb4f 100755 --- a/notes +++ b/notes @@ -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)