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 -->
  #4 (permalink)  
Old 10-07-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,391
Quote:
Originally Posted by yale_work View Post
Thanks Vidyadhar,

It is giving error, saying no match for if.....I tried by putting fi...did not work....also it is not any file in which I will have TIME and TTY..........Actually in my shell script I will execute "ps -ef | grep test" command first and then in the second line I want to do that operation on the result set of "ps -ef | grep test" command.

I think we should check 6th (TTY) and 7th (TIME) column values. Please suggest.
ya i know its not file.. thats why i selected the required fields from ps -ef by using -o option it will give only TTY ,TIME and ARGS field.
did you tried if ;then;fi?? if its not working take TTY and TIME in some variables and then compare it in inside if loop..
regards,
vidyadhar