I have a loop function in .bash_aliases to help me quickly monitor certain commands.
loop()
{
while sleep 1;
do $@;
done
}
However, I cannot get this command to work:
# loop mysql vb -e 'select count(*) from postparsed;'
# loop mysql vb -e "select count(*) from postparsed;"
# loop "mysql vb -e 'select count(*) from postparsed;'"
All of these return a mysql invalid command line parameter error, because the entire string isn't getting passed to mysql.
mysql Ver 15.1 Distrib 10.4.12-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Usage: mysql [OPTIONS] [database]
I also confirmed with this:
loop echo mysql vb -e 'select count(*) from postparsed;'
mysql vb -e select count(*) from postparsed;
mysql vb -e select count(*) from postparsed;
Looks fine to me.
What am I missing? Why is the loop() function not processing my mysql command correctly?
Thank you