![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SSH problems | ysk | UNIX for Advanced & Expert Users | 1 | 07-19-2007 02:16 AM |
| Problems AIX and SAN. | fjgonzalez | AIX | 4 | 07-18-2007 02:15 PM |
| Problems with Last | By_Jam | UNIX for Advanced & Expert Users | 3 | 09-29-2006 12:12 AM |
| Few problems | vivekshankar | UNIX for Dummies Questions & Answers | 3 | 05-21-2005 09:26 AM |
| 'make' problems (compliation problems?) | xyyz | UNIX for Advanced & Expert Users | 5 | 11-05-2001 07:47 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
awk problems
If i try the -f option for awk, i get the "awk: can't open " error message
The following awk statement works fine without the -f option `awk <$RULES '/^IGNORE_POLICY / { print $2 }'` Below how i turned on debugging to show what is happening, can someone provide me with some advice!!!! $RULES = /home/nberrors_rules_jm_NEW.txt_TEST $2 = ^219$ of the following (STATUS_MESSAGE ^219$ See BOA-NBU-1. Partial success) MESSAGE=`awk <$RULES '/^STATUS_MESSAGE / && '$STCODE' ~ $2 { for(a=3;a<NF+1;a++) { printf "%s ",$a }}'` ........... + + awk /^STATUS_MESSAGE / && 219 ~ $2 { for(a=3;a<NF+1;a++) { printf "%s ",$a }} + 0< /home/nberrors_rules_jm_NEW.txt_TEST awk: syntax error near line 1 awk: bailing out near line 1 MESSAGE= STCODE_POL_MESSAGE=`awk <$RULES '/^STATUS_MESSAGE_POLICY / && '$STCODE' ~ $2 && toupper("'$POLICY'") ~ toupper($3) { for(a=4;a<NF+1;a++) { printf "%s ",$a }}'` ........... + + awk /^STATUS_MESSAGE_POLICY / && 219 ~ $2 && toupper("emacromsq14") ~ toupper($3) { for(a=4;a<NF+1;a++) { printf "%s ",$a }} + 0< /home/nberrors_rules_jm_NEW.txt_TEST awk: syntax error near line 1 awk: bailing out near line 1 STCODE_POL_MESSAGE= |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Your command-line syntax is confusing, but I do not see any program syntax errors. Maybe try...
Code:
MESSAGE=`awk '/^STATUS_MESSAGE / && STCODE ~ $2 {for(a=3;a<=NF;a++) printf "%s ",$a}' STCODE="$STCODE" $RULES`
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|