Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Capture commands that launched processes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Capture commands that launched processes
Authored by: javierhz on Jun 29, '07 05:08:23PM

Well, if I'm not wrong, there's no direct way to do this using "standard" shell script commands. As 'ps' shows the start time in 3 different formats depending on how distant it is from current time, you can create 3 functions to load the time and convert it, for example, to seconds from the epoch. Once you have the time in seconds it's very easy to test which is between limits and print it.

There are many ways to achieve that issue, ranging from awk and 'tail -n +2' with other standard shell scripting filters to integrated scripting languages.

As an alternative you can look for the items by yourself showing the start time:
ps -axwwo start -o command | grep [l]ame > ~/Desktop/lame_command.txt

If you write it, please, post it for the community as a new thread ;)



[ Reply to This | # ]