LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-15-2011, 04:56 AM   #1
flamingo_l
Member
 
Registered: Jul 2010
Posts: 41

Rep: Reputation: 0
Regular expression in Ubuntu


hi,

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.

Code:
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.

Code:
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.
 
Old 02-15-2011, 05:57 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,562

Rep: Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939
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?
 
Old 02-16-2011, 10:33 PM   #3
flamingo_l
Member
 
Registered: Jul 2010
Posts: 41

Original Poster
Rep: Reputation: 0
hi,

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


Reply

Tags
awk


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
regular expression (.*?) uttam_h Programming 6 05-30-2008 05:45 PM
regular expression [tT]h* sycamorex Programming 3 01-15-2008 04:43 PM
Need help with Regular Expression subaruwrx Linux - Newbie 6 09-04-2004 07:48 PM
Regular Expression Help WeNdeL Linux - General 1 08-14-2003 10:08 AM
Regular Expression slizadel Programming 4 07-28-2003 05:16 AM


All times are GMT -5. The time now is 01:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration