How to execute this command for 5min or 300sec inside the script.Basically my intention is to get the info about the process using truss command for a period of 300 secs inside a script. and then continue with the next process
truss -po a1.txt $PID_Detail [2>&1 >> file] & # truss in background use strin in brackets if you want the output into a file
sleep 300
kill $! # kill the bg process
Cleaner1-------->2158680 2519258
truss: 0915-021 Invalid process id: [2.
kill: 2760708: no such process
Archiver1-------->3579956 3371106
truss: 0915-021 Invalid process id: [2.
kill: 1868006: no such process
all text within the brackets and the brackets itself are optional
if you want trussouput in a file:
truss -po a1.txt $PID_Detail 2>&1 >> file &
if you want truss outut on the screen
truss -po a1.txt $PID_Detail &
all text within the brackets and the brackets itself are optional
if you want trussouput in a file:
truss -po a1.txt $PID_Detail 2>&1 >> file &
if you want truss outut on the screen
truss -po a1.txt $PID_Detail &
here the o/p file is a1.txt i.e i m here redirecting the o/p to file a1.txt. But the above command is not killing the truss process
i m asking how to run this command in background and then kill the truss command after sleep of 300 seconds
What i do not understand is how can i break or interrupt truss after it has given the basic list of system calls for processes
When i run truss on some processes i can see that they r in sleep state waiting for an input. Using ctrl-c in command prompt i can break from the truss output. but how to achieve this in a script
still wating for the help ! Below the script i m using to truss and then kill it after 300sec. but the problem is that it is not able to kill the truss after 300 sec