The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AWK (NAWK) and filtering values Nicol UNIX for Dummies Questions & Answers 11 04-23-2008 05:40 AM
awk/nawk returning decimal values? moutaye Shell Programming and Scripting 1 03-25-2008 03:04 PM
awk/nawk returning decimal values? moutaye SUN Solaris 1 03-25-2008 03:02 PM
is it possible to pass external variable values to nawk? swamymns Shell Programming and Scripting 1 02-02-2006 06:13 AM
nawk and variables plimpix Shell Programming and Scripting 8 07-11-2005 12:56 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-12-2008
saniya saniya is offline
Registered User
  
 

Join Date: May 2008
Posts: 4
Thumbs up how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me

in the script i have a nawk block which has a variable count

nawk{
.
.
.
count=count+1
print count

}

now i want to access the value of the count variable outside the awk block,like..
Code:
s=`expr count / m`
(m is a shell variable )

i came across how to access shell variables inside the awk block,but is it possible to access the values of awk variables outside the awk block?

please help me
thanks in advance.

Last edited by Yogesh Sawant; 05-13-2008 at 09:57 AM.. Reason: added code tags
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0