Search Results

Search: Posts Made By: DTriniWay
4,376
Posted By DTriniWay
OK, so I'm back. Apparently, adding this line to...
OK, so I'm back. Apparently, adding this line to the script did the trick:
jobs -p | while read pid;do ps -p $pid -oargs | perl -pe 's/.*?config\/(.*?).conf/$1/';done | grep -v COMMAND
I had a...
4,376
Posted By DTriniWay
Hey Nithin, Thanks for your suggestion. ...
Hey Nithin,

Thanks for your suggestion.
trap killsubs INT
killsubs()
{
echo "CTRL+C was pressed"
jobs -l | awk '{ print $i }'
jobs -p|xargs kill
echo "Agents were killed!"
exit...
4,376
Posted By DTriniWay
I tried out your next script too and it works...
I tried out your next script too and it works like a charm! I used to spend hours trying to keep track of what was going on with programs. I often had so many terminals up and running it was just...
4,376
Posted By DTriniWay
OK. Thank you for your thoughts. Before I...
OK. Thank you for your thoughts.

Before I try your experiment, I commented out the following lines from your script:
for agent in "$@"
do
./run-any-agent $agent & # run in background
done...
4,376
Posted By DTriniWay
Cool. Thank you very much. Thank you again. ...
Cool. Thank you very much.

Thank you again.

---------- Post updated at 02:14 PM ---------- Previous update was at 02:11 PM ----------

So, I was looking at the kill-all-agents script here:...
4,376
Posted By DTriniWay
No and no. Sorry! :-) Anyway, I redid the test...
No and no. Sorry! :-) Anyway, I redid the test and I got something like this:
Then I hit Ctrl+C. However, after a few seconds, the programs started back up. That was annoying! I'll look at your...
4,376
Posted By DTriniWay
Scrutinizer, Thanks you for your post. I'll...
Scrutinizer,

Thanks you for your post. I'll check what you wrote out and report back. I also tried:
ps aux | grep run-any-agent
And it returned:
DTW 31685 0.0 0.0 2988 1368 pts/7 S ...
4,376
Posted By DTriniWay
Thanks for your reply. Cool. So far I've been...
Thanks for your reply. Cool. So far I've been doing:
ps aux | moreAnd then I scroll through the list to find the PIDs. Sometimes when I use the "kill -9" command, though, it doesn't seem to kill the...
4,376
Posted By DTriniWay
2pugs, Thanks for your reply. So, if I...
2pugs,

Thanks for your reply.

So, if I understood this right, you're suggesting that I write another script called "run-all-agents" to execute the "run-any-agent" script - right?

What do...
4,376
Posted By DTriniWay
Help with Running More than One Program
Folks,

I'm really new to scripting and was wondering if you could help me out. I have the following script that I inherited:
#!/bin/bash
#
# Usage
# From the agent directory:
#...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 02:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy