-   Programming (
-   -   Regular expression in Ubuntu (

flamingo_l 02-15-2011 04:56 AM

Regular expression in Ubuntu

Am using Ubuntu 10.10 operating system.

The following command would remove the leading astericks, spaces, slashes, tabs and is present in an awk script.


gsub(/^[/* \t]*/,"")
The above code is working fine when i run in Cygwin on windows machine. But when i run in Ubuntum throws the following error.


awk: ./Format.awk: line 30: regular expression compile failed (bad class -- [], [^] or [)
awk: 30: unexpected character '\'
awk: ./Format.awk: line 30: runaway regular expression /,""); ...

Please help me in resolving this error.

grail 02-15-2011 05:57 AM

Knowing Ubuntu, this is because the default awk variation is actually mawk, in my opinion a rather sub standard version.
Try removing this and installing gawk and see if the error still persists?

flamingo_l 02-16-2011 10:33 PM


The problem is solved problem by downloading gawk package in Ubuntu... :)

All times are GMT -5. The time now is 05:33 AM.