Sponsored Content
Full Discussion: Help with script
Top Forums Shell Programming and Scripting Help with script Post 302814613 by bakunin on Wednesday 29th of May 2013 08:00:13 PM
Old 05-29-2013
You read in the whole file into memory here:

Code:
A[++c] = $1

It is natural outcome of a limited resource like memory, that, as the files grow larger, at some point this memory is exhausted. What follows is the allocation error you see.

Try to use a less memory-intensive algorithm.

I hope this helps.

bakunin
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

2. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

5. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
memchan(n)																memchan(n)

__________________________________________________________________________________________________________________________________________________

NAME
memchan - Create and manipulate memory channels SYNOPSIS
package require Tcl package require memchan memchan ?-initial-size len? _________________________________________________________________ DESCRIPTION
This manpage documents both the overall package and the command memchan. The package itself provides a number of in-memory channels which can utilized to o capture stream-like information in a natural way instead of using set and append to manipulate strings o or to transfer data between interpreters, in the same thread or not. COMMAND
memchan ?-initial-size len? creates a chunk-oriented in-memory channel and returns its handle. If an initial size is specified the system will pre-allocate len bytes of buffer space for the contents. This is no restriction on the ultimate size of the channel, it will always grow as much as is necessary to accomodate the data written into it. The channels created here can be transfered between interpreters in the same thread and between threads, but only as a whole. It is not possible to use them to create a bi- or unidirectional connection between two interpreters. Memory channels created by memchan provide two read-only options which can be queried via the standard fconfigure command. These are -length The value of this option is the number of bytes currently stored in the queried memory channel. -allocated The value of this option is the number of bytes currently allocated by the queried memory channel. This number is at least as big as the value of -length. As the channels generated by memchan grow as necessary they are always writable. This means that a writable fileevent-handler will fire continuously. The channels are also readable if they contain more than zero bytes and the seek location is not and the end of the channel. Under these conditions a readable fileevent-handler will fire continuously. Note that writing to such a channel usually occurs at the end, thus supressing readable events. This also means that users have to take care to seek the channel to a location before the end before trying to read data back. SEE ALSO
fifo, fifo2, null, random, zero KEYWORDS
channel, chunk, i/o, in-memory channel, memchan COPYRIGHT
Copyright (c) 1996-2003 Andreas Kupries <andreas_kupries@users.sourceforge.net> Memory channels 2.2 memchan(n)
All times are GMT -4. The time now is 10:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy