Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: AWKPATH que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 7 Topic 2210 of 2297
Post > Topic >>

Re: AWKPATH question

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.
 




 7 Posts in Topic:
AWKPATH question
twf_cc <twfccc@[EMAIL   2008-03-28 20:56:07 
Re: AWKPATH question
Ed Morton <morton@[EMA  2008-03-28 22:59:42 
Re: AWKPATH question
"Rajan" <svr  2008-03-29 01:46:51 
Re: AWKPATH question
twf_cc <twfccc@[EMAIL   2008-03-29 07:22:46 
Re: AWKPATH question
Ed Morton <morton@[EMA  2008-03-29 09:25:20 
Re: AWKPATH question
Steffen Schuler <schul  2008-03-29 17:05:58 
Re: AWKPATH question
stan <smoore@[EMAIL PR  2008-03-29 19:26:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 20:47:24 CDT 2008.