On Oct 20, 2007, at 7:01 AM, Carey Tyler Schug wrote:


Let me give one example of glitz vs functionality. From within a shell
script, I wanted to trace up my parent task tree in a shell script.
This
was something simple, I wanted to see if there was a scripting task
running to record the session, so I could start one only if none was
already running. In Solaris this was fairly simple. In Linux, a
similar
(though different) command, gave a beautiful multicolored display on a
terminal, but would have been very difficult to parse to see if the
script command was directly in my parent tree.

ps --forest doesn't seem to give me any colors at all, and "ps --
forest | grep script" is probably roughly what you were looking for,
although if you were feeling studly you'd use awk to throw away the
first few fields and then parse the "\_" bits of the tree out.

Did I know about --forest before I wrote this note?  No.  I just
thought, "I bet there's a ps option to do that", did a "man ps", hit
forward slash, typed "tree", and got what looked like the right
answer.  That's procps, which is standard on SuSE, CentOS, and
Debian, anyway.

Adam

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to