The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-07-2008
yale_work yale_work is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 28
getting results after using ps command

Hi,

I want to use the following ps coomand:
ps -ef | grep test

Result of this command is:
Test 161220 1 0 Oct 04 - 1:11 /test/test

Just mentioning the description of each value in the result:
UID PID PPID C STIME TTY TIME CMD
Test 161220 1 0 Oct 04 - 1:11 /test/test

NOW the requirement is to check the 'TTY' value and 'TIME' value. I have to do certain operations if TTY = '-' and TIME !=0:00 ..........Please help me how to do that?

Thanks.