Computing.Net > Forums > Unix > Shell variable in AWK

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell variable in AWK

Reply to Message Icon

Name: dk0871
Date: December 23, 2004 at 13:45:58 Pacific
OS: Sun OS 5.6
CPU/Ram: Not Known
Comment:

I need some help of how to use shell variable in awk '{action}' section? Tried several way doesn't seem to be get it right.

Thanks in advance.


dkr



Sponsored Link
Ads by Google

Response Number 1
Name: Borvix
Date: December 24, 2004 at 08:41:33 Pacific
Reply:

It is subject to whole lesson ”how”, but I think you may find this link to be useful.
http://www.vectorsite.net/tsawk.html


Learn more at www.TechnoProfessor.com


0

Response Number 2
Name: nails
Date: December 29, 2004 at 07:53:10 Pacific
Reply:

I prefer to pass shell variables to an awk script, but this little stub embedds one:


VAR=5
echo "test" |awk '{ print "'"$VAR"'" }'

Regards,

Nails


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Shell variable in AWK

using string variable in awk www.computing.net/answers/unix/using-string-variable-in-awk/8040.html

use variable of shell script in awk www.computing.net/answers/unix/use-variable-of-shell-script-in-awk/4570.html

awk variables in shell script www.computing.net/answers/unix/awk-variables-in-shell-script/6201.html