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
passing Argument Shahul Shell Programming and Scripting 4 11-13-2008 08:50 AM
Argument passing using for or while loop jisha Shell Programming and Scripting 4 04-09-2008 01:21 AM
passing argument into awk prkfriryce Shell Programming and Scripting 4 02-01-2007 04:44 PM
Problem with Argument Passing A_Rod Shell Programming and Scripting 4 09-13-2006 12:47 PM
Passing argument from one script to other lloydnwo Shell Programming and Scripting 3 10-27-2005 03:06 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 03-19-2009
saifurshaon saifurshaon is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 29
Passing non Awk Argument in Awk

Dear Conerned,
I am facing a situation where i need to pass an argument which is non-awk variable like

day=090319
awk '/TID:R/ && /TTIN:/' transaction.log

I want to add this day variable like below

awk '/TID:R$day/ && /TTIN:/' transaction.log


But it is not working.
  #2 (permalink)  
Old 03-19-2009
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,322
Quote:
Originally Posted by saifurshaon View Post
Dear Conerned,
I am facing a situation where i need to pass an argument which is non-awk variable like

day=090319
awk '/TID:R/ && /TTIN:/' transaction.log

I want to add this day variable like below

awk '/TID:R$day/ && /TTIN:/' transaction.log


But it is not working.
Code:
 awk -v var=$day '$0 ~ "TID:R"var && /TTIN:/' transaction.log
Regards
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 05:19 PM.


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