Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #1131

Re: HOW2 pass args to awk?

From Bill Marcum <bill@lat.localnet>
Newsgroups comp.os.linux.misc, comp.lang.awk
Subject Re: HOW2 pass args to awk?
Followup-To comp.os.linux.misc
Date 2011-05-17 07:55 -0400
Organization Mankind for Ethical Animal Treatment
Message-ID <slrnit4oho.5u2.bill@lat.localnet> (permalink)
References <iqt4hb$fcn$1@dont-email.me>

Cross-posted to 2 groups.

Followups directed to: comp.os.linux.misc

Show all headers | View raw


["Followup-To:" header set to comp.os.linux.misc.]
On 2011-05-17, no.top.post@gmail.com <no.top.post@gmail.com> wrote:
> I had suspected that ARGV could do it.
> But it fails.  Are you fooling with me?
>    gawk '
>        BEGIN {
>            arg1 = ARGV[1]
>            arg2 = ARGV[2]
> print "arg1=" arg1  <--- 'arg1' is 'empty'/uninitialised
> }'
>
> exit
> /arg1/&&/arg2/{print FILENAME ":" $0}'\
>  `find /mnt/p11/PhysicalSpace/DirTest  -type f`
>
In the above script, the gawk command ends at  }' . It has no 
arguments. "exit" is interpreted as a shell command, and the lines 
after it are ignored.


-- 
"Remember when teachers, public employees, Planned Parenthood, NPR and PBS
crashed the stock market, wiped out half of our 401Ks, took trillions in
TARP money, spilled oil in the Gulf of Mexico, gave themselves billions in
bonuses, and paid no taxes? Yeah, me neither."

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: HOW2 pass args to awk? no.top.post@gmail.com - 2011-05-17 06:27 +0000
  Re: HOW2 pass args to awk? Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-05-17 09:12 +0200
    Re: HOW2 pass args to awk? Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> - 2011-05-17 00:21 -0700
      Re: HOW2 pass args to awk? Harold Stevens <wookie@jimbo.localdomain> - 2011-05-17 09:17 -0500
      Re: HOW2 pass args to awk? Aragorn <aragorn@chatfactory.invalid> - 2011-05-17 17:36 +0200
    Re (2): HOW2 pass args to awk? no.top.post@gmail.com - 2011-05-29 15:56 +0000
      Re: Re (2): HOW2 pass args to awk? Bill Marcum <bill@lat.localnet> - 2011-05-29 13:05 -0400
        Re (3): HOW2 pass args to awk? no.top.post@gmail.com - 2011-05-30 02:22 +0000
          Re: Re (3): HOW2 pass args to awk? Aragorn <aragorn@chatfactory.invalid> - 2011-05-30 05:09 +0200
  Re: HOW2 pass args to awk? Bill Marcum <bill@lat.localnet> - 2011-05-17 07:55 -0400
    Re (2): HOW2 pass args to awk? no.top.post@gmail.com - 2011-05-29 15:56 +0000
      Re: Re (2): HOW2 pass args to awk? Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-05-29 17:46 +0000
        Re (3): HOW2 pass args to awk? no.top.post@gmail.com - 2011-05-30 02:22 +0000
          Re: Re (3): HOW2 pass args to awk? Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-05-30 09:01 +0000
          Re: Re (3): HOW2 pass args to awk? and more Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-05-31 11:05 +0000
            Re: Re (3): HOW2 pass args to awk? and more Ralf Fassel <ralfixx@gmx.de> - 2011-05-31 14:35 +0200
              Re: Re (3): HOW2 pass args to awk? and more Ed Morton <mortonspam@gmail.com> - 2011-05-31 07:56 -0500
              Re: Re (3): HOW2 pass args to awk? and more Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-05-31 14:14 +0000
                Re: Re (3): HOW2 pass args to awk? and more Ralf Fassel <ralfixx@gmx.de> - 2011-06-01 10:41 +0200
              Re (4): HOW2 pass args to awk? and more no.top.post@gmail.com - 2011-06-06 10:26 +0000
                Re: Re (4): HOW2 pass args to awk? and more Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-06-06 14:01 +0000
            Re (4): HOW2 pass args to awk? and more no.top.post@gmail.com - 2011-06-06 04:58 +0000

csiph-web