Actually, it means exactly what it says... Too many open files. The close() isn't working for some reason. Memory usage is a nonissue, since we're not actually storing anything in memory.
I think the close should come first, otherwise it will never close the previous file, just the current one (which gets immediately reopened).
Last edited by Corona688; 06-04-2013 at 02:50 PM..
Hi all
I have file f1 like this:
Set AM/PM indicator to PM started|14155|
Generate Error Re|7|
Projected Cash Ba|741|
Roll System Date |4|
Projected Cash Balances started|2|
Process Mark To Market started|13429|
Process paydowns started|14189|
Process Fixed Inc|439|
Process Mark To... (3 Replies)
Hi guys,
i have a big file with the following format.This includes header(H),detail(D) and trailer(T) information in the file.My problem is i have to search for the character "6h" at 14 th and 15 th position in all the records .if it is there i have to write all those records into a... (1 Reply)
Hi
I want to read one row record from a text file.
For eg: I have Sample.txt file with one row of record like
123456768
I want to get the above value from the file and assign it to a variable in my script. Please guide me how to proceed.
Thanks,
Soll (2 Replies)
Guys,
I'm very new to Unix script. I need to add some logics into the existing script.
Read a record
1) if it's a header record then verify the file sequence no aginst the file sequence no in UDB control table.
2) if Step 1 is ok then CONNECT UDB otherwise stop or abend.
3) if... (0 Replies)
Hello, I am a very novice user of awk, I have a set of files named file001, file002, file003, file004, etc., each contains four fields (columns of data) separated each by a uneven number of spaces. I want to substitute those spaces by a TAB, so I am using this line of awk script:
awk -v OFS="\t"... (4 Replies)
Hi All,
Do we know how to read input file within awk script and send output toanother log file. All this needs to be in awk script, not in command line. I am running this awk through crontab.
Cat my.awk
#!/bin/awk -f
function test(var){
some code}
{
}
END
{
print"test code"
} (5 Replies)
I am trying to omit the trailer record in a variable width file
I tried using awk 'NR >1 { print prev } { prev = $0 }' filename
The above command is giving output but somehow it is trimming columns from the record. For example if my record has columns A,B,C,D
The awk gives output as A,B,C
... (4 Replies)
Hi Everyone,
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file? Please let me know what is the awk command for this?
Regards
Rakesh (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file?... (6 Replies)
Hello,
I need to collect some statistical results from a series of files that are being generated by other software. The files are tab delimited. There are 4 different sets of statistics in each file where there is a line indicating what the statistic set is, followed by 5 lines of values. It... (8 Replies)
Discussion started by: LMHmedchem
8 Replies
LEARN ABOUT DEBIAN
shtool-scpp
SHTOOL-SCPP.TMP(1) GNU Portable Shell Tool SHTOOL-SCPP.TMP(1)NAME
shtool-scpp - GNU shtool C source file pre-processor
SYNOPSIS
shtool scpp [-v|--verbose] [-p|--preserve] [-f|--filter filter] [-o|--output ofile] [-t|--template tfile] [-M|--mark mark] [-D|--define
dname] [-C|--class cname] file [file ...]
DESCRIPTION
This command is an additional ANSI C source file pre-processor for sharing cpp(1) code segments, internal variables and internal functions.
The intention for this comes from writing libraries in ANSI C. Here a common shared internal header file is usually used for sharing
information between the library source files.
The operation is to parse special constructs in files, generate a few things out of these constructs and insert them at position mark in
tfile by writing the output to ofile. Additionally the files are never touched or modified. Instead the constructs are removed later by the
cpp(1) phase of the build process. The only prerequisite is that every file has a ``"#include ""ofile"""'' at the top.
This command provides the following features: First it avoids namespace pollution and reduces prototyping efforts for internal symbols by
recognizing functions and variables which are defined with the storage class identifier ``cname''. For instance if cname is ``intern'', a
function ``"intern void *foobar(int quux)"'' in one of the files is translated into both a ``"#define foobar __foobar"'' and a ``"extern
void *foobar(int quux);"'' in ofile. Additionally a global ``"#define" cname "/**/"'' is also created in ofile to let the compiler silently
ignore this additional storage class identifier.
Second, the library source files usually want to share "typedef"s, "#define"s, etc. over the source file boundaries. To achieve this one
can either place this stuff manually into tfile or use the second feature of scpp: All code in files encapsulated with ``"#if "dname ...
"#endif"'' is automatically copied to ofile. Additionally a global ``"#define" dname 0'' is also created in ofile to let the compiler
silently skip this parts (because it was already found in the header).
OPTIONS
The following command line options are available.
-v, --verbose
Display some processing information.
-p, --preserve
Preserves ofile independent of the generated ``#line'' lines. This is useful for Makefiles if the real contents of ofile will not
change, just line numbers. Default is to overwrite.
-f, --filter filter
Apply one or more pre-processing sed(1) filter commands (usually of type ``"s/.../.../"'') to each input file before their input is
parsed. This option can occur multiple times.
-o, --output ofile
Output file name. Default is "lib.h".
-t, --template tfile
Template file name. Default is "lib.h.in".
-M, --mark mark
Mark to be replaced by generated constructs. Default is "%%MARK%%".
-D, --define dname
FIXME. Default is "cpp".
-C, --class cname
FIXME. Default is "intern".
EXAMPLE
# Makefile
SRCS=foo_bar.c foo_quux.c
foo_p.h: foo_p.h.in
shtool scpp -o foo_p.h -t foo_p.h.in
-M %%MARK%% -D cpp -C intern $(SRCS)
/* foo_p.h.in */
#ifndef FOO_P_H
#define FOO_P_H
%%MARK%%
#endif /* FOO_P_H */
/* foo_bar.c */
#include "foo_p.h"
#if cpp
#define OURS_INIT 4711
#endif
intern int ours;
static int myone = 0815;
intern int bar(void)
{
ours += myone;
}
/* foo_quux.c */
#include "foo_p.h"
int main(int argc, char *argv[])
{
int i;
ours = OURS_INIT
for (i = 0; i < 10; i++) {
bar();
printf("ours now %d
", ours);
}
return 0;
}
HISTORY
The GNU shtool scpp command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1999 for GNU shtool. Its was prompted
by the need to have a pre-processing facility in the GNU pth project.
SEE ALSO shtool(1), cpp(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-SCPP.TMP(1)