Reputation: 3
I have two queries:
ps aux | pgrep -f mongod_arb
//it will fetch pidkill -SIGUSR1 pid
//it will kill processI want to run them as single query.
I have already tried below different queries but none is working:
echo "$(kill -SIGUSR1 ) $(ps aux | pgrep -f mongod_arb)";
kill -SIGUSR1 echo "$(ps aux | pgrep -f mongod_arb)";
echo "$(kill -SIGUSR1 ) $(ps aux | pgrep -f mongod_arb)";
kill -SIGUSR1 echo "$(ps aux | pgrep -f mongod_arb)";
How can I do this to achieve single line query?
Upvotes: 0
Views: 81
Reputation: 3203
can you try this :
ps aux | pgrep -f mongod_arb | xargs kill -SIGUSR1
ps aux | pgrep -f mongod_arb | xargs sudo kill -SIGUSR1 # if permission issues.
Upvotes: 1