Saturday, 15 August 2015

linux - run command continuously in background using tcl -


I am using TCL / hope for an ethernet switch test. I want to run some test equipment every 2 seconds and in the background. Output can be ignored

This is what I want to do the following: There is a block of code that has closed the code from another block, which overhaul and repeats:

  exec { $ MyCommandSleep $ sleepDuration  

$ myCommand can be either a list or string, which is even more convenient $ SleepDuration is a number

The second block of code I have a general procedure in which sponging processes will also be involved and are talking to them or have already existed Speaking with the moon.

Is it possible that with TCL? I am running on Debian Linux 6 in VMWare. The code does not need to be portable for other platforms.

I tried to use the clock but I'm not sure how to do the following:

  exec {watch $ MyCommand} switching to the previously connected process With "\ x03"  

In the simplest case, where the command is running fast , You use the every pattern:

  proc every {delay script} {uplevel # $ script} $ delay [information level 0]} every 2000 { Exec $ yourCommand $ yourArgument & amp;}  

Until then, If you are serving the loop, the order will be run for each 2 seconds (== 2000 milliseconds).


No comments:

Post a Comment