Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get progress of exec command

Status
Not open for further replies.

fdservices

IS-IT--Management
Mar 10, 2005
52
FR
Put simply I would like to follow the progress of a background task.

The task would be run as: exec some_task &

While it is running I would like to check its progress: while {true} {test_progress}

So I was thinking: set pid [exec some_task &]
and follow the progress of $pid ... but really I'm stuck.

Can someone give me a clue on how to proceed?

Thanks

Andrew
 
If anyone is interested I worked it out:

set pid [exec some_task &]
while {[catch {exec ps --no-headers -p $pid}] == 0} {do_something; update}

May not be the best way but it seems to work anyway

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top