I want to kill process. Without kill cmd it works fine. But with kill cmd i get:
grep: invalid option -- 'S'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
awk: cmd. line:1: {print
awk: cmd. line:1: ^ unexpected newline or end of string
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Doesn't work:
ssh someUser@someHost kill $(ps -aux | grep 'screen -S cats' | awk '{print $2}')
Works fine:
ssh someUser@someHost ps -aux | grep 'screen -S cats' | awk '{print $2}'