Hi,
i want awk to read a file and place it's content into two arrays. When trying to read these arrays with a "for a in ${source_path} "-Loop it gives the right result. But when trying to access directly (/bin/echo ${source_path}) it doesn't work.
I read "all "the awk threads in this forum and... (6 Replies)
I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows:
$count = 0;
while ( $count < $#test )
{
`sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`;
`cat 0 >... (2 Replies)
Hi,
My doubt is how to access array elements..
Situation is as below:
#!/bin/ksh
set -x
typeset -i x=0
typeset -i y=0
typeset -i BID=0
typeset -i count=0
while ] ; do
x=`expr $x + 1`;
hwmgr show scsi > scsi.tmp
while read line; do
set... (1 Reply)
Hi,
can I use array elements ( all ) in conditional statements?
the problem is ,the total number of elements is not known.
e.g
A is an array with elements - 1,2,3
now if i want to test if the 1 st field of input record is either 1,2 or 3, i can do something like this
if ( $1 ~... (1 Reply)
i have an array call ignore. it is set up
ignore=34th56
ignore=re45ty
ignore=rt45yu
.
.
ignore=rthg34
n is a variable. I have another variable that i read from a different file. It is $2 and it is working the way i expect. array ignore read and print correct values.
in the below if... (2 Replies)
i just want to dump my array and see if it contains the values i am expecting. It should print as follows,
ignore=345fht
ignore=rthfg56
.
.
.
ignore=49568g
Here is the code. Is this even possible to do? please help
termReport.pl < $4 | dos2ux | head -2000 | awk '
BEGIN... (0 Replies)
Hello,
I have two files in the following format;
file1:
A B C D
E F G H
I J K L
file2:
1 2 3 4
5 6 7 8
9 10 11 12
I have read them both in to multi-dimensional arrays. I need a file that has column 2 of the first file printed out for each column 3 of the second file ie...
... (3 Replies)
Hi all,
I can’t resolve an array element access issue on (Linux/pdksh) .. So I’m positing for advice.By the way - a friend demonstrated to me - same script works as expected under Solaris.
I have been working on a documentation project where many *.jpg screen shots are used in the... (4 Replies)
Hi all,
I'm dealing with a bash script to merge the elements of a set of files and counting how many times each element is present. The last field is the file name.
Sample files:
head -5 *.tab==> 3J373_P15Ac1y2_01_LS.tab <==
chr1 1956362 1956362 G A hom ... (7 Replies)
Discussion started by: lsantome
7 Replies
LEARN ABOUT DEBIAN
tst
tst(3) InterNetNews Documentation tst(3)NAME
tst - ternary search trie functions
SYNOPSIS
#include <inn/tst.h>
struct tst;
struct tst *tst_init(int node_line_width);
void tst_cleanup(struct tst *tst);
int tst_insert(struct tst *tst, const unsigned char *key, void *data, int option, void **exist_ptr);
void *tst_search(struct tst *tst, const unsigned char *key);
void *tst_delete(struct tst *tst, const unsigned char *key);
DESCRIPTION
tst_init allocates memory for members of struct tst, and allocates the first node_line_width nodes. A NULL pointer is returned by tst_init
if any part of the memory allocation fails. On success, a pointer to a struct tst is returned.
The value for node_line_width must be chosen very carefully. One node is required for every character in the tree. If you choose a value
that is too small, your application will spend too much time calling malloc(3) and your node space will be too spread out. Too large a
value is just a waste of space.
tst_cleanup frees all memory allocated to nodes, internal structures, as well as tst itself.
tst_insert inserts the string key into the tree. Behavior when a duplicate key is inserted is controlled by option. If key is already in
the tree then TST_DUPLICATE_KEY is returned, and the data pointer for the existing key is placed in exist_ptr. If option is set to
TST_REPLACE then the existing data pointer for the existing key is replaced by data. Note that the old data pointer will still be placed
in exist_ptr.
If a duplicate key is encountered and option is not set to TST_REPLACE then TST_DUPLICATE_KEY is returned. If key is zero length then
TST_NULL_KEY is returned. A successful insert or replace returns TST_OK. A return value of TST_ERROR indicates that a memory allocation
error occurred while trying to grow the node free.
Note that the data argument must never be NULL. If it is, then calls to tst_search will fail for a key that exists because the data value
was set to NULL, which is what tst_search returns. If you just want a simple existence tree, use the tst pointer as the data pointer.
tst_search finds the string key in the tree if it exists and returns the data pointer associated with that key.
If key is not found then NULL is returned, otherwise the data pointer associated with key is returned.
tst_delete deletes the string key from the tree if it exists and returns the data pointer assocaited with that key.
If key is not found then NULL is returned, otherwise the data pointer associated with key is returned.
HISTORY
Converted to POD from Peter A. Friend's ternary search trie documentation by Alex Kiernan <alex.kiernan@thus.net> for InterNetNews 2.4.0.
$Id: tst.pod 9074 2010-05-31 19:01:32Z iulius $
INN 2.5.3 2011-06-10 tst(3)