The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
how to fix this awk script?
.
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 fix this awk script?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
02-11-2009
joeyg
modérateur
Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
I think it is because you are always printing a value. So, you are not over-writing 'a' ni the instance of the 4th line, so when you print the variable, you are getting the last stored value of 'a'.
Perhaps as the first line ater your else, do a
Code:
a=""
to blank out the last 'a' value?
joeyg
View Public Profile
Find all posts by joeyg
Find joeyg's past nominations received
Find joeyg's present nominations given