I have the following in my .bash_profile:
k9 () { for A in $(ps -A | grep $* | sed 's/^\([A-Za-z0-9]*\).*/\1/' ; ) ; do "kill -9 $A"; done }
The script supposed to grep the var inputed in the command line S* get the PIDs those and execute a kill -9 on each of them. But instead I am getting this:
Machine:~ mach$ k1 Chromium
-bash: kill -9 81922: command not found
-bash: kill -9 82009: command not found
-bash: kill -9 82423: command not found
-bash: kill -9 82424: command not found
-bash: kill -9 82560: command not found
-bash: kill -9 82561: command not found
-bash: kill -9 82563: command not found
-bash: kill -9 82608: command not found
-bash: kill -9 85243: command not found
-bash: kill -9 85248: command not found
-bash: kill -9 85321: command not found
Thanks in advance!