Hi,
I am using sub to remove blank spaces and one pattern(=>) from the input string. It works fine when I am using two sub functions for the same. However it is giving error while I am trying to remove both spaces and pattern using one single sub function.
Working:
$ echo " OK => " |awk '{sub(/^ *+| *$/,"",$0);sub(/=>/,"",$0);print $0;}'
OK
$
Error
$ echo " OK => " |awk '{sub(/^ *+| *$+//=>/,"",$0);print $0;}'
awk: There is a regular expression error.
?, *, or + not preceded by valid regular expression
The source line number is 1.
The error context is
{sub(/^ *+| >>> *$+/ <<< /=>/,"",$0);print $0;}
$
Need your help in combining the both patterns in single sub function.
Thanks in Advacne....