Sponsored Content
Top Forums Shell Programming and Scripting What is solution for this error? Post 302800371 by hanson44 on Monday 29th of April 2013 03:25:58 PM
Old 04-29-2013
Your original question was why your program was crashing. I answered your question. Your program is running out of memory because it is creating giant arrays that consume all the memory. Apparently mawk crashes before gawk, but this is not a "bug in mawk". It's incredibly bad for this kind of program to be consuming several GB of RAM. I take it you're not predicting the global weather patterns or something like that. I find it ironic and amusing that posters on this group frequently criticize for one extra command in a script that makes the script clearer, but are not throwing up their hands in outrage over this kind of coding horror.

I think you have several choices, depending on the nature of the project, which you have totally failed to share with us:

1) If you want to get more swap space, you can post that as a separate thread.

2) If you want to "fix" the current program, I think it is way beyond the scope of this forum, because the program is way too complex, full of indecipherable code, code that you are even still editing as you post it. Based on the few functions you have posted, it would impossible for us to diagnose that kind of situation. On the other hand, you could post simple test cases for part of the project, using code tags to show input, and expected output.

3) You could re-engineer the program. Here you could ask general questions.

4) You could post for advice as to how to best handle the organizational challenges of dealing with a program that is failing.

Good luck, and at least now you know the cause of the crashes.
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need the solution

Write a program to print all prime numbers from 1 to 300. (3 Replies)
Discussion started by: paniruddha
3 Replies

2. Ubuntu

What is solution for this error "tar: Exiting with failure status due to previous errors"?

Does anyone know what is solution for this error ?tar: Exiting with failure status due to previous errors from last 3 days I am trying to take backup of home/user directory getting again and again same error please anyone give me solution (8 Replies)
Discussion started by: Akshay Hegde
8 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgawk | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for gawk is available on http://opensolaris.org. Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 02:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy