When I run this command in bash it works fine:
$ while sleep 1; do mysqladmin proc | grep tbl1; done
But, when I add it to my .bash_aliases or just run:
$ alias loop='while sleep 1; do $@; done'
It produces this error (using ls
as an example):
$ loop ls
-bash: syntax error near unexpected token `ls'
My goal is to incorporate this loop command as an alias into my shell so I can use it more frequently. I've tried escaping it different ways, including double quotes, single quotes, ${$@}
and more.