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
how to make ksh to work on solaries mail2sant Shell Programming and Scripting 13 04-16-2008 03:13 AM
How to make this work heru_90 Shell Programming and Scripting 3 09-07-2006 12:04 AM
nohup--how to make it work? abhijeetkul Shell Programming and Scripting 1 10-29-2005 11:48 AM
How to make sccs work akrathi UNIX for Dummies Questions & Answers 1 10-21-2005 04:44 PM
make alt key work (emacs etc) ora OS X (Apple) 0 11-23-2003 07:04 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 06-04-2008
rider29 rider29 is offline
Registered User
  
 

Join Date: May 2008
Posts: 33
how to make this work

hi,

I have been trying to make my script work but could not, tried some of the suggestions from here but I am not getting the correct result.


I have a script that was

Param1 ="$1"
Param2 ="$2"

$Script1 log -t "$param1" "$param2" | grep operation > /dev/null || {
echo "Message" >&2
exit 1 }

exit 0


Now I need to introduce a function in place of grep operation

something like

{
awk ' / dgdg/
..
END {
if(condition)
{
I should exit out like Exit 0
}
else
{
I am unable to pull in the operation
|| { echo "Message" >&2 exit 1}

}

}'
}


Please suggest how we can get

Last edited by rider29; 06-05-2008 at 02:18 PM..
  #2 (permalink)  
Old 06-05-2008
rider29 rider29 is offline
Registered User
  
 

Join Date: May 2008
Posts: 33
I figured out the answer my self, We can redirect the Message at "else " part using print"***Message***" >"&2"


at
awk' ....
If (){

}

else{

print"***Message***" >"&2"

} '

Simple
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 11:28 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