![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Weird Issue with crontab. | Cameron | HP-UX | 3 | 04-21-2008 11:36 PM |
| a weird issue with "while" block | sleepy_11 | Shell Programming and Scripting | 7 | 08-06-2007 11:33 PM |
| weird domain issue. | thirddegreekris | UNIX for Advanced & Expert Users | 2 | 05-04-2007 12:42 AM |
| HP-UX weird FTP ? | IngmarMeins | HP-UX | 10 | 11-29-2005 08:22 PM |
| Weird SSH issue | AKM | UNIX for Advanced & Expert Users | 6 | 11-08-2004 02:13 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Weird Awk issue
Hi All,
a bit of a weird one here. I'm trying to pass a variable into an awk command, and I keep getting an error. I have the line nawk -F"," -v red=$random_variable '{print $red}' $w_dir/$file_name > $w_dir/${column_name} that keeps failing with the error nawk: can't open file {print $red} source line number 1 It's a bit weird, because I actually have another similar line later in my script that works perfectly abbreviation=$(head -$counter $w_dir/$file_name| tail -1|nawk -F"," -v rad=$index '{print $rad}') Maybe that's because the output is being assigned to another variable? Any assistance will be very much appreciated. Thanks |
|
||||
|
When I echo $random_variable, which have done while trying to troubleshoot, I get a number - 10, 11 or 13.
I have even tried running substituting the value nawk -F"," -v red=13 '{print $red}' $w_dir/$file_name > $w_dir/${column_name} Still the same error. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|