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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Results of command execution into array alirezan Shell Programming and Scripting 2 08-18-2008 11:17 PM
Iteration through the results from a unix command deviprasad83 Shell Programming and Scripting 4 06-12-2008 04:04 AM
joining command results, and substitution ncatdesigner Shell Programming and Scripting 6 04-17-2008 11:37 AM
Setting the Results of a Command to a Variable stky13 UNIX for Dummies Questions & Answers 1 02-29-2008 03:00 PM
How to output the results of the AT command - properly! SpanishPassion UNIX for Dummies Questions & Answers 4 12-04-2005 10:27 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-07-2008
yale_work yale_work is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 28
That I had changed......but as currently I am not getting '-' from my ps command (that will come when there will be a erros and I will send mail in THEN condition....). I have pts/2 as TTY value....I get the following message:

pts/2: 0403-009 The specified number is not valid for this command.
  #2 (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,390
use "==" instead of "-eq"
  #3 (permalink)  
Old 10-07-2008
yale_work yale_work is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 28
I am replacing -eq with == and it gives syntax error.....can you please suggest me in the following...
if [ `ps -efo tty,time,args|awk '/test/{print $1}'` -eq '-' -a `ps -efo tty,time,args|awk '/test/{print $2}'` -ne "0:00" ]
  #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,390
Quote:
Originally Posted by yale_work View Post
I am replacing -eq with == and it gives syntax error.....can you please suggest me in the following...
if [ `ps -efo tty,time,args|awk '/test/{print $1}'` -eq '-' -a `ps -efo tty,time,args|awk '/test/{print $2}'` -ne "0:00" ]
oh ho,try this
Code:
 
if [ "`ps -efo tty,time,args|awk '/test/{print $1}'`" == "-" -a "`ps -efo tty,time,args|awk '/test/{print $2}'`"  != "0:00" ]
  #5 (permalink)  
Old 10-07-2008
yale_work yale_work is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 28
Thanks for your patience and time.
Closed Thread

Bookmarks

Tags
filter values, ps command

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0