LinuxQuestions.org
Visit Jeremy's Blog.
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, 05: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, 06:57 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,686

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
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, 11: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 06:45 PM
regular expression [tT]h* sycamorex Programming 3 01-15-2008 05:43 PM
Need help with Regular Expression subaruwrx Linux - Newbie 6 09-04-2004 08:48 PM
Regular Expression Help WeNdeL Linux - General 1 08-14-2003 11:08 AM
Regular Expression slizadel Programming 4 07-28-2003 06:16 AM


All times are GMT -5. The time now is 11:46 PM.

Main Menu
Advertisement
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