LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-26-2003, 08:51 AM   #1
realos
Member
 
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113

Rep: Reputation: 15
awk/gawk handling of "delete" ?


hello awk-programmers!

I am having some problem with a awk script I wrote. It is working fine with gawk (version 3.1.2) but may not work with awk on HP-UX.

relevant part of the script is:

conddescription["something"]=1;
delete conddescription;

But there is always an error message :

" syntax error The source line is 6.
The error context is
/HELLO/ { delete >>> desc; <<<
awk: The statement cannot be correctly parsed.
The source line is 6."

Can any one give me a hint why this should work in gawk but not in awk?

thanks for any idea.
 
Old 06-26-2003, 09:45 AM   #2
realos
Member
 
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113

Original Poster
Rep: Reputation: 15
I got it

okay it works in awk with following statement.

for (i in conddesciption) delete conddescription[i]; works fine.


delete conddescription; is an extension in gawk that is not available in other awk derivatives.
 
  


Reply


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
Replacing "function(x)" with "x" using sed/awk/smth Griffon26 Linux - General 3 11-22-2006 10:47 AM
The program Screen, "delete" key doesn't work TroelsSmit Linux - Newbie 0 10-13-2004 07:55 AM
oops - made a file called "--dereference" - how do I delete it? BrianK Linux - General 2 06-21-2004 08:37 PM
How do you delete a file called "--tape-lengh=1"? I've tried everything... Huddlebum Linux - General 1 01-01-2004 10:11 PM
help with "next" command in "awk" realos Programming 2 05-13-2003 03:34 PM


All times are GMT -5. The time now is 09:09 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