|
|
get command to run for x seconds then quit
|
|
|
|
Mac Elite
Join Date: Oct 2001
Location: Internet
Status:
Offline
|
|
I am doing an experiment and I want to determine the data rate of a proprietary networked device.
What I want to do is connect to it with Netcat and see how much data I get in a minute. Is there any way I can tell Netcat (or any other cmd line app) to run for only a specified amount of time?
I am looking for a simple command like this:
time -60 | nc 1.2.3.4 1234
thanx
|
20+ year MacNN forum member. MacBook Air 11" 1.6Ghz 4GB 128GB Backlit Keyboard, 4S, iPad Mini
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by hadocon:
I am doing an experiment and I want to determine the data rate of a proprietary networked device.
What I want to do is connect to it with Netcat and see how much data I get in a minute. Is there any way I can tell Netcat (or any other cmd line app) to run for only a specified amount of time?
I am looking for a simple command like this:
time -60 | nc 1.2.3.4 1234
thanx
Something like this should work:
Code:
/usr/bin/nc 1.2.3.4 1234 > nc.log 2>&1 &
pid=`ps -auxww | grep "/usr/bin/nc"`
sleep 60
kill -9 $pid
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|