Talk About Network



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 > AWKPATH questio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 2210 of 2236
Post > Topic >>

AWKPATH question

by twf_cc <twfccc@[EMAIL PROTECTED] > Mar 28, 2008 at 08:56 PM

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

rgd

twf




 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 Wed May 14 13:08:23 CDT 2008.