![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Weird Issue with crontab. | Cameron | HP-UX | 3 | 04-21-2008 08:36 PM |
| a weird issue with "while" block | sleepy_11 | Shell Programming and Scripting | 7 | 08-06-2007 08:33 PM |
| weird domain issue. | thirddegreekris | UNIX for Advanced & Expert Users | 2 | 05-03-2007 09:42 PM |
| HP-UX weird FTP ? | IngmarMeins | HP-UX | 10 | 11-29-2005 04:22 PM |
| Weird SSH issue | AKM | UNIX for Advanced & Expert Users | 6 | 11-08-2004 10:13 AM |
|
|
LinkBack | Thread Tools | 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 |
| Forum Sponsor | ||
|
|
|
|||
|
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. |