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: awk pipe an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 7 Topic 2208 of 2297
Post > Topic >>

Re: awk pipe and system call

by pk <pk@[EMAIL PROTECTED] > Mar 28, 2008 at 04:27 PM

uwcssa@[EMAIL PROTECTED]
 wrote:

> However, the following never works:
> 
>       BEGIN{ myvar1=0;}
>       { myvar2 =1;
>         system("echo " $myvar1  $myvar2);
> 
> Any ideas? thanks a bunch

- use myvar1 and myvar2, without the "$";
- put a space between the variables:

$ echo "blah" | awk 'BEGIN {myvar1=0}
{myvar2=1;system("echo "myvar1" "myvar2)}'
0 1


-- 
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
 




 7 Posts in Topic:
awk pipe and system call
"uwcssa@[EMAIL PROTE  2008-03-28 07:59:31 
Re: awk pipe and system call
pk <pk@[EMAIL PROTECTE  2008-03-28 16:27:36 
Re: awk pipe and system call
Ed Morton <morton@[EMA  2008-03-28 10:15:45 
Re: awk pipe and system call
pk <pk@[EMAIL PROTECTE  2008-03-28 16:40:43 
Re: awk pipe and system call
Ed Morton <morton@[EMA  2008-03-28 10:42:12 
Re: awk pipe and system call
privat@[EMAIL PROTECTED]   2008-04-25 10:23:19 
Re: awk pipe and system call
Janis Papanagnou <Jani  2008-04-27 12:06:46 

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:41:17 CDT 2008.