bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash 2.05a isn't calling gawk as expected


From: Neil Parks
Subject: Re: Bash 2.05a isn't calling gawk as expected
Date: Fri, 7 Jun 2002 14:31:22 -0500

On 5 Jun 2002 at 17:33, Paul Jarc wrote:

> nparks@torah.org wrote:
> > When I use bash 2.05a, each invocation of gawk produces an error msg
> > saying that gawk cannot open a file named "-v".
> ...
> >   tail session_log |
> >     gawk -v Username=`basename $i` -v TodayDate=`date '+%b %e'` \
> >       -v CurrentYear=`date '+%Y'` -v BlockFlag=$blockflag \
> >       '$0 ~ /[Uu]ser/ && $0 !~ Username && $0 ~ TodayDate \
> >       && $0 ~ CurrentYear \
> >       {print Username, $0 >> BlockFlag}'  
> 
> I suspect you need to double-quote the command substitutions and
> variable expansions.

Tried various combinations of quote marks, and mirabile dictu, 
finally hit on one that works:

19,20c19,20
<     awk -v Username=`basename $i` -v TodayDate=`date '+%b %e'` \
<       -v CurrentYear=`date '+%Y'` -v BlockFlag=$blockflag \
---
>     awk -v Username="`basename $i`" -v TodayDate="`date '+%b %e'`" \
>       -v CurrentYear="`date '+%Y'`" -v BlockFlag="$blockflag" \

Thanks.


...This message brought to you by:  NEIL EDWARD PARKS, 
Beachwood, Ohio
mailto:nparks@torah.org      http://nparks.vze.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]