Pass an AWK variable to a pipeline program as a parameter 
Author Message
 Pass an AWK variable to a pipeline program as a parameter

Just unquote the ARGC in the print. i.e.

print data | "prog1 | prog2 " ARGC " | prog3";

Cesar
--
Please remove the UPPERCASE characters from my e-mail address for the real
thing

Quote:

>Hi.

> I'm trying to use an awk variable as a parameter in a UNIX
>pipeline called from within the awk program.  In particular, I'd like
>to have line like

>print data | "prog1 | prog2 ARGC | prog3";

>in the awk program where prog2 is a program which expects a numerical
>argument (as well as a data stream) and ARGC _should be_ the intrinsic
>variable containing the number of arguments to the awk program itself.
>The above construction does not work, of course.

>Any advice on how to do this will be appreciated.  Thanx.

>Dan Katz




Tue, 08 May 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. passing shell variable into awk program

2. passing parameter from awk back to korn shell

3. Help passing command line parameters to awk scripts

4. THANKS: Help passing command line parameters to awk script

5. ext. command with awk variable as parameter

6. passing ?use variables as a parameter

7. HELP: Passing parameters or Variables in Functions

8. Passing variables into a parameter of an executable

9. Passing variables into a parameter of an executable

10. Help - Metadata variable passing parameters to DML queries

11. Passing command line variables to AWK in shell script

12. How to pass shell variable to awk?

 

 
Powered by phpBB® Forum Software