Computing.Net > Forums > Unix > awk and ksh

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.

awk and ksh

Reply to Message Icon

Name: xaiver
Date: July 25, 2005 at 02:04:07 Pacific
OS: HPUX
CPU/Ram: UNIX
Comment:

Hi,

I have a ksh which uses seperated awk programs inside. Can i define a variable in the ksh and then using awk to refer to it?
eg

under ksh i have
abc=count+120

so in the awk part which is written as part of the ksh, can i use it ?
eg
array[1]=abc

Thanks




Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: July 25, 2005 at 07:17:13 Pacific
Reply:

This link discusses using shell variables in awk:

http://www.tek-tips.com/faqs.cfm?fid=1281


0

Response Number 2
Name: Luke Chi
Date: August 12, 2005 at 18:07:33 Pacific
Reply:

VAR="the value of VAR"

echo dummy | nawk -v VAR_IN_AWK="$VAR" '{print VAR_IN_AWK}'

Luke Chi


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: awk and ksh

awk and shell programming,need help www.computing.net/answers/unix/awk-and-shell-programmingneed-help/4944.html

awk and looping www.computing.net/answers/unix/awk-and-looping/7184.html

awk and t utility problem www.computing.net/answers/unix/awk-and-t-utility-problem/4643.html