mirror of https://github.com/nealey/irc-bot
make notes case-insensitive
This commit is contained in:
parent
da716ad947
commit
dc9f49e350
7
notes
7
notes
|
@ -3,6 +3,11 @@
|
||||||
db=$1; shift
|
db=$1; shift
|
||||||
text=$1
|
text=$1
|
||||||
|
|
||||||
|
lc () {
|
||||||
|
printf "%s" "$1" | tr A-Z a-z
|
||||||
|
}
|
||||||
|
|
||||||
|
sender=$(lc "$sender")
|
||||||
if [ -f $db/$sender ]; then
|
if [ -f $db/$sender ]; then
|
||||||
echo "Welcome back, $sender. Your messages:"
|
echo "Welcome back, $sender. Your messages:"
|
||||||
cat $db/$sender
|
cat $db/$sender
|
||||||
|
@ -12,7 +17,7 @@ fi
|
||||||
case "$text" in
|
case "$text" in
|
||||||
note\ *)
|
note\ *)
|
||||||
args=${text#note }
|
args=${text#note }
|
||||||
who=${args%% *}
|
who=$(lc "${args%% *}")
|
||||||
what=${args#* }
|
what=${args#* }
|
||||||
when=$(date)
|
when=$(date)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue