12
9
I am making bash script for my use. How can i run a command for certain time, like 20 second and terminate command? I tried a lot of solutions but nothing works, I also tried timeout command with no success. Please give me some solution for this.
for example: I want to run this command in script and terminal after 10 sec
some command
Thanks buddy it works but Now I have 1 problem. I want to see output which is created by command but xmessage windows doesn't show anything. – Umair Riaz – 2013-05-08T17:51:12.543
@UmairRiaz: xmessage was just an example. To adapt your example in the question and log the output of the command use
some command > logfile &
in the first line. Afterwards you can analyselogfile
. – mpy – 2013-05-08T21:00:27.950