Unix/Linux Go Back    



Use while loop to read file and use ${file} for both filename input into awk and as string to print

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member rovf Regarding:
Use while loop to read file and use ${file} for both filename input into awk and as string to print.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 05-17-2017
rovf rovf is offline
Registered User
 
Join Date: Jun 2011
Last Activity: 12 September 2017, 2:10 AM EDT
Posts: 171
Thanks: 24
Thanked 31 Times in 27 Posts
You didn't say which awk you are using. If your awk is linked to nawk or gawk, there is also an alternative to the solution posted by Don Cragun, in that you could export your shell variable (so that it becomes an environment variable) and use awk's built-in ENVIRON array to access it. If you follow this route, I strongly recommend to write the variable in all-uppercase.