Newsgroups: comp.lang.awk
From: "Ed Morton" <mortons...@gmail.com>
Date: Fri, 14 Sep 2012 18:35:49 GMT
Local: Fri, Sep 14 2012 2:35 pm
Subject: Re: windows scripting with gawk
Serious_Developer <ehabaziz2...@gmail.com> wrote:
<snip>
> I must recall that thread because I did not find other group who could > be asked. Sorry for that inconvenience but I have to ask this again > for the urgent need . > I am calling that batch file that I want to return to it a value from > gawk script but it is not effective ???? > ENVIRON["codeinsidebat"]=codeawk Ignoring the Windows/batch stuff it sounds like you're trying to change
Look (in UNIX, no idea what the Windows equivalent is):
$ x=7; awk 'BEGIN{ ENVIRON["x"]=8; print ENVIRON["x"] }'; echo "$x" If you want to change the value of a variable in your environment as a
$ x=7; x=$(awk 'BEGIN{ ENVIRON["x"]=8; print ENVIRON["x"] }'); echo "$x"
or generate a script to set the value and execute that script, e.g. with
$ x=7; eval $(awk 'BEGIN{ ENVIRON["x"]=8; print "x="ENVIRON["x"] }'); echo
Regards,
Ed.
Posted using www.webuse.net You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||