Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing a variable into awk is a issue.. 1

Status
Not open for further replies.

jdespres

MIS
Aug 4, 1999
230
US
environment: v445 Solaris 9

I would like to pass a variable to awk....

I need to pass yesterdays date into awk so I can search and print all lines that have yesterdays date in column $7 in format: mm/dd/yy

YESTERDAY=`GetDate -1 '+%m/%d/%y'

bpdbjobs|awk '$7 == "$YESTERDAY"'

This doesn't work.....

Thanks....

Joe
 
What about this ?
Code:
bpdbjobs|awk '$7 == "'$YESTERDAY'"'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
hhhhmmmmm........

I thought I tried this combo!

I guess not! It worked!

Thanks!

Joe Despres
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top