i wrote a script to convert dates to the formate i want .it works fine but the conversion is tkaing lot of time . Can some one help me tweek this script
Hi ,
i'm searching for files over many Aix servers with rsh command using this request :
find /dir1 -name '*.' -exec ls {} \;
and then count them with "wc"
but i would improve this search because it's too long and replace directly find with ls command but "ls *. " doesn't work.
and... (3 Replies)
Hi All,
I am using grep command to find string "abc" in one file .
content of file is
***********
abc = xyz
def= lmn
************
i have given the below mentioned command to redirect the output to tmp file
grep abc file | sort -u | awk '{print #3}' > out_file
Then i am searching... (2 Replies)
hi someone tell me which ways i can improve disk I/O and system process performance.kindly refer some commands so i can do it on my test machine.thanks, Mazhar (2 Replies)
I have a data file of 2 gig
I need to do all these, but its taking hours, any where i can improve performance, thanks a lot
#!/usr/bin/ksh
echo TIMESTAMP="$(date +'_%y-%m-%d.%H-%M-%S')"
function showHelp {
cat << EOF >&2
syntax extreme.sh FILENAME
Specify filename to parse
EOF... (3 Replies)
Hi Friends,
I wrote the below shell script to generate a report on alert messages recieved on a day. But i for processing around 4500 lines (alerts) the script is taking aorund 30 minutes to process.
Please help me to make it faster and improve the performace of the script. i would be very... (10 Replies)
Hi All,
I have written a script as follows which is taking lot of time in executing/searching only 3500 records taken as input from one file in log file of 12 GB Approximately.
Working of script is read the csv file as an input having 2 arguments which are transaction_id,mobile_number and search... (6 Replies)
Hi,
I have around one lakh records. I have used XML for the creation of the data.
I have used these 2 Perl modules.
use XML::DOM;
use XML::LibXML;
The data will loo like this and most it is textual entries.
<eid>19000</eid>
<einfo>This is the ..........</einfo>
......... (3 Replies)
Hello,
Attached is my very simple C++ code to remove any substrings (DNA sequence) of each other, i.e. any redundant sequence is removed to get unique sequences. Similar to sort | uniq command except there is reverse-complementary for DNA sequence. The program runs well with small dataset, but... (11 Replies)
Hello,
For several of our scripts we are using awk to search patterns in files with data from other files. This works almost perfectly except that it takes ages to run on larger files. I am wondering if there is a way to speed up this process or have something else that is quicker with the... (15 Replies)
Discussion started by: SDohmen
15 Replies
LEARN ABOUT LINUX
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)