The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
how to print field n of line m
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
how to print field n of line m
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
7
(
permalink
)
01-14-2009
krishmaths
Registered User
Join Date: Sep 2006
Location: Mysore, India
Posts: 191
You need to use the -v option in awk to use shell variables, as below:
Code:
awk -v c=$counter 'NR==c {print $25}' $argv[1]
krishmaths
View Public Profile
Find all posts by krishmaths
Find krishmaths's past nominations received
Find krishmaths's present nominations given