home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / question / 14704 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.4 KB

  1. Path: sparky!uunet!mcsun!sunic!dkuug!newsie!newsie!i3423
  2. From: bobby@dc.dk (Bobby Billingsley)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: nawk functions
  5. Message-ID: <i3423.724436782@newsie>
  6. Date: 15 Dec 92 16:26:22 GMT
  7. References: <1992Dec9.171505.4865@dkbfpny.com>
  8. Sender: news@newsie.dc.dk (USENET News System)
  9. Organization: Datacentralen A/S
  10. Lines: 34
  11. Originator: i3423@zarina.dc.dk
  12. Nntp-Posting-Host: zarina.dc.dk
  13.  
  14. vlad@dkbfpny.com (Vladimir Stavitsky) writes:
  15.  
  16. >Hi,
  17. >here is the problem: i'm trying to define some function with nawk,
  18. >but it is not recognised:
  19.  
  20. >echo some string | \
  21.                    v--------------------Here's the culprit!!!
  22. >nawk 'function fff (x) 
  23. >         { print x }
  24.  
  25. >         { print $0; fff ($0) }
  26.  
  27.  
  28. >Below is what i'm getting from nawk:
  29.  
  30. >nawk: funny variable 604320: n=fff s="" f=1 t=40
  31. > input record number 1
  32. > source line number 4
  33. >some string
  34.  
  35. >Any help would be appreciated; especially by email.
  36. >Thanks very much
  37. >Vlad
  38.  
  39. I haven't been able to find it in the docs I have, but just remove that
  40. space between the function name and the left parenthesis, and you'll
  41. be fine.
  42.  
  43. -- 
  44. :   Bobby Billingsley                   : Remember to love while you dare to   :
  45. :   Datacentralen, Denmark              : remember to live while you do so     :
  46. :   Phone: +45 4371-8122 Ext. 3337      :........................-.Piet.Hein...:
  47. :   E-mail: bobby@dc.dk                 : DoD# 80884 : Ride=Yamaha XJ600, 1986 :
  48.