by "Rajan" <svrajan@[EMAIL PROTECTED]
>
Mar 29, 2008 at 01:46 AM
"Ed Morton" <morton@[EMAIL PROTECTED]
> wrote in message
news:47EDBEAE.6080703@[EMAIL PROTECTED]
>
>
> On 3/28/2008 10:56 PM, twf_cc wrote:
>> I have set enviroment AWKPATH in ~/.bash_profile including ~/lib/awk
>> which contains some function
>> at command line using, there's no problem.
>> fang@[EMAIL PROTECTED]
~
>> $ uname -a
>> CYGWIN_NT-5.1 bash 1.5.25(0.156/4/2) 2008-03-05 19:27 i686 Cygwin
>>
>> fang@[EMAIL PROTECTED]
~
>> $ echo $AWKPATH
>> /usr/lib/awk:/home/fang/lib/awk
>>
>> fang@[EMAIL PROTECTED]
~
>> $ echo abcd |awk -f reverse.awk --source '{print reverse($0)}'
>> dcba
>>
>> put in a file ,I get an error
>>
>> fang@[EMAIL PROTECTED]
~
>> $ cat junk
>> #! /bin/gawk -f reverse.awk --source
>>
>> {
>> print reverse($0)
>> }
>>
>> fang@[EMAIL PROTECTED]
~
>> $ echo abcd |./junk
>> gawk: fatal: can't open source file ` reverse.awk --source ' for
>> reading (No such file or directory)
>>
>> calling gawk from shell, there's no problem
>>
>> $ cat junk2
>> #! /bin/bash
>>
>> gawk -f reverse.awk --source '{print reverse($0)}'
>>
>> fang@[EMAIL PROTECTED]
~
>> $ echo abcd | ./junk2
>> dcba
>>
>> how to solve the problem, thanks
>
> You probably haven't ex****ted AWKPATH. This is more of an OS-specific
> issue and
> so is OT here so follow up at comp.unix.shell if that's not it.
>
> Ed.
>
Looks like gawk is receiving the filename as "reverse.awk --source"
instead
of reverse.awk. comp.unix.shell is more appropriate.