I'm trying to write a ksh script that uses awk, but I want to pass variables to awk. For example (not working):
if ];then
searchstr=$1
lsof -i | awk '{if($9~/SEARCHSTR/) print $2} SEARCHSTR=$searchstr'
else
echo "usage: $0 <search string>"
fi
I tried several options. Is it... (3 Replies)
How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ?
I've given portion of the script here to explain the problem.
Portion of Script 1
=============
-----
-----
tmp=`a.ksh p1 p2 p3`
if then
# error processing
fi
-----... (10 Replies)
Hi - Help needed.
I have an input file that looks something like this, but with a lot more entries:
A
Customer1
B
4500
C
8000
A
Customer2
B
6422
C
8922
I need to be able to print details for each customer on one line per customer.
ie. if I could print these to a file and then cat... (3 Replies)
Hi all,
I'm using awk in a .ksh script to split one file by line prefix into different files (up to 4). The files are named after the prefix in the line, and a sequence no.
Is there any way to get the filenames in to variables too? I need _ftpfile1, _ftpfile2, _ftpfile3 and _ftpfile4 which are... (2 Replies)
How do I assign values to reference variables?
I am assigning a variable name to --> $user_var
Then I am trying to change its underlying variable value by
$((user_var))=$user_value .. its failing,,
Please let me know if there is a way to do this dynamically..
FileA.props... (5 Replies)
Hi Guys,
I have an issue with awk and variables. I have trawled the internet and forums but can't seem to get the exactt syntax I need.
I have tried using awk -v and all sorts of variations but I have hit a brick wall. I have spent a full day on this and am just going round in circles.
... (3 Replies)
Using ksh to call a function which has awk script embedded.
It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Hi,
I have a script where I make a sqlplus connection. In the script I have multiple sql queries within that sqlplus connection. I want the result of the queries to be stored in shell variables declared earlier. I dont want to use procedures. Is there anyway else.
Thanks in advance..
Cheers (6 Replies)
Hi All,
i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way??
#!/bin/ksh
##script is sample.ksh
age=$1
gender=$2
class=$3
.
.
.... (3 Replies)
Hi All,
I need to read values of 10 columns from oracle query and assign the same to 10 unix variables. The query will return only one record(row).
I tried to append all these columns using a delimiter(;) in the select query and assign the same to a single variable(V) in unix. I thought I... (3 Replies)
Discussion started by: hkrishnan91
3 Replies
LEARN ABOUT CENTOS
th_make_cells
thai/thcell.h(3) libthai thai/thcell.h(3)NAME
thai/thcell.h -
Thai string cell custering.
SYNOPSIS
Data Structures
struct thcell_t
Thai char cell representation.
Functions
void th_init_cell (struct thcell_t *cell)
Initialize a Thai cell.
size_t th_next_cell (const thchar_t *s, size_t len, struct thcell_t *cell, int is_decomp_am)
Get first cell from string.
size_t th_prev_cell (const thchar_t *s, size_t pos, struct thcell_t *cell, int is_decomp_am)
Get previous cell from string.
size_t th_make_cells (const thchar_t *s, size_t len, struct thcell_t cells[], size_t *ncells, int is_decomp_am)
Tokenize string into cells.
Detailed Description
Thai string cell custering.
Function Documentation
void th_init_cell (struct thcell_t *cell)
Initialize a Thai cell.
Parameters:
cell : pointer to the cell to initialize
Initializes values in the Thai cell struct.
size_t th_make_cells (const thchar_t *s, size_tlen, struct thcell_tcells[], size_t *ncells, intis_decomp_am)
Tokenize string into cells.
Parameters:
s : the string
len : the length of string
cells : the array of output cells buffer
ncells : the address of integer storing the number of cells provided by the buffer, and to keep the number of resulting cells on return
is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells
Returns:
total characters consumed
Tokenizes the string bounded by s and len into cells, and stores at most *ncells resulting cells in the cells buffer. On return, *ncells is
also set to the total cells stored in cells[].
size_t th_next_cell (const thchar_t *s, size_tlen, struct thcell_t *cell, intis_decomp_am)
Get first cell from string.
Parameters:
s : the string
len : the length of string
cell : the output buffer
is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells
Returns:
total chars consumed by the cell
Gets first cell from the string bounded by s and len, and, if cell is not null, stores the cell data in it.
size_t th_prev_cell (const thchar_t *s, size_tpos, struct thcell_t *cell, intis_decomp_am)
Get previous cell from string.
Parameters:
s : the string
pos : the position in string to get cell previous to
cell : the output buffer
is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells
Returns:
total chars consumed by the cell
Gets last cell from the string bounded by s and pos, and if cell is not null, stores the cell data in it.
Author
Generated automatically by Doxygen for libthai from the source code.
Version 0.1.14 Tue Jun 17 2014 thai/thcell.h(3)