The UNIX and Linux Forums  

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
Bourne and decimals?? kdyzsa Shell Programming and Scripting 1 05-06-2008 11:54 PM
Bourne Script help Pits Shell Programming and Scripting 2 09-06-2007 03:15 AM
Bourne-again shell mrsamer UNIX for Dummies Questions & Answers 3 09-30-2006 03:42 AM
bourne script help Heedunk Shell Programming and Scripting 1 02-05-2004 08:49 PM
bourne if, then, else Priest_Ridden UNIX for Dummies Questions & Answers 2 12-12-2001 11:18 AM

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 05-12-2008
kdyzsa kdyzsa is offline
Registered User
  
 

Join Date: May 2008
Posts: 14
GREP in Bourne

I have a problem.

Suppose I have a log transport.log with the ff:
>>
tp finished with return code: 203
meaning:
wrong syntax in tp call
<<

I'm working on creating a script to find out if there are error are not. Unfortunately, the only way to check if there is error is if the return code is 0. I've tried to grep it with 'grep 0 transport.log` but it also return the one with 203. I just need to know if the return code is 0. not 10, no 90, not 103, but 0, and since grep searches for patterns it always returns even if the code is 10, 470. Anyway around this? I need to get the line if the return code is 0.
  #2 (permalink)  
Old 05-12-2008
penchal_boddu penchal_boddu is offline
Registered User
  
 

Join Date: Apr 2008
Location: Bangalore
Posts: 127
Hi,

for solving the problem , u can grep on return code: 0 instead of 0.

on HP machine, u can use -x option. when u use x oprion, it will match only distinct words and not substrings.

Can somebsoy suggest me whats the equivalent on solaris and aix.
  #3 (permalink)  
Old 05-12-2008
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
u can use the option -w with grep, this will match the exact string which you want to search.
  #4 (permalink)  
Old 05-12-2008
kdyzsa kdyzsa is offline
Registered User
  
 

Join Date: May 2008
Posts: 14
thanks

thanks for the advices. I'll try it now
Closed Thread

Bookmarks

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:32 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