Sponsored Content
Top Forums Shell Programming and Scripting Assigning multiple variables in ksh script Post 302918545 by seekryts15 on Wednesday 24th of September 2014 05:54:37 AM
Old 09-24-2014
Computer Assigning multiple variables in ksh script

Is it possible to have a user input multiple words in one line and have the script assign each word a variable? I'm stuck please assist.

Example using "BILL JOHN SARA JILL" as what the user could type:

Code:
printf "Enter account names: "      BILL JOHN SARA JILL  
read input

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing variables to awk from ksh script

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)
Discussion started by: rein
3 Replies

2. Shell Programming and Scripting

passing a variables value from the called script to calling script using ksh

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)
Discussion started by: rajarkumar
10 Replies

3. Shell Programming and Scripting

ksh help assigning specific values to variable in script

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)
Discussion started by: frustrated1
3 Replies

4. Shell Programming and Scripting

awk splits file in to multiple - how to get filenames in variables withing ksh?

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)
Discussion started by: spidermike
2 Replies

5. Shell Programming and Scripting

Assigning values to reference variables for a dynamic menu driven script.

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)
Discussion started by: kchinnam
5 Replies

6. Shell Programming and Scripting

awk issue expanding variables in ksh script

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)
Discussion started by: gazza-o
3 Replies

7. Shell Programming and Scripting

ksh passing to awk multiple dyanamic variables awk -v

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)
Discussion started by: highnthemnts
1 Replies

8. Shell Programming and Scripting

How to store results of multiple sql queries in shell variables in ksh?

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)
Discussion started by: gonchusirsa
6 Replies

9. Shell Programming and Scripting

Running a script with multiple variables like 25 variables.

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)
Discussion started by: Lakshman_Gupta
3 Replies

10. Shell Programming and Scripting

Assigning multiple column's value from Oracle query to multiple variables in UNIX

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
thai/thrend.h(3)						      libthai							  thai/thrend.h(3)

NAME
thai/thrend.h - Thai string rendering. SYNOPSIS
Macros #define TH_BLANK_BASE_GLYPH 0xdd Blank base glyph, for floating upper/lower vowel. Typedefs typedef unsigned char thglyph_t Glyph code type. Functions int th_render_cell_tis (struct thcell_t cell, thglyph_t res[], size_t res_sz, int is_decomp_am) Render the given cell using TIS-620 glyph set. int th_render_cell_win (struct thcell_t cell, thglyph_t res[], size_t res_sz, int is_decomp_am) Render the given cell using Thai Windows glyph set. int th_render_cell_mac (struct thcell_t cell, thglyph_t res[], size_t res_sz, int is_decomp_am) Render the given cell using Mac Thai glyph set. int th_render_text_tis (const thchar_t *s, thglyph_t res[], size_t res_sz, int is_decomp_am) Render the given text using TIS-620 glyph set. int th_render_text_win (const thchar_t *s, thglyph_t res[], size_t res_sz, int is_decomp_am) Render the given text using Thai Windows glyph set. int th_render_text_mac (const thchar_t *s, thglyph_t res[], size_t res_sz, int is_decomp_am) Render the given text using Mac Thai glyph set. Detailed Description Thai string rendering. Function Documentation int th_render_cell_mac (struct thcell_tcell, thglyph_tres[], size_tres_sz, intis_decomp_am) Render the given cell using Mac Thai glyph set. Parameters: cell : the cell to render res : the buffer for storing output glyph string res_sz : the size of res buffer is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells Returns: total number of glyphs written to res[] Calculates glyphs from Mac Thai glyph set for the given cell, and store the glyph string in res, terminated with ''. If resulting glyphs are longer than the provided buffer, only the first res_sz glyphs are stored. int th_render_cell_tis (struct thcell_tcell, thglyph_tres[], size_tres_sz, intis_decomp_am) Render the given cell using TIS-620 glyph set. Parameters: cell : the cell to render res : the buffer for storing output glyph string res_sz : the size of res buffer is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells Returns: total number of glyphs written to res[] Calculates glyphs from TIS-620 glyph set for the given cell, and store the glyph string in res, terminated with ''. If resulting glyphs are longer than the provided buffer, only the first res_sz glyphs are stored. int th_render_cell_win (struct thcell_tcell, thglyph_tres[], size_tres_sz, intis_decomp_am) Render the given cell using Thai Windows glyph set. Parameters: cell : the cell to render res : the buffer for storing output glyph string res_sz : the size of res buffer is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells Returns: total number of glyphs written to res[] Calculates glyphs from Thai Windows glyph set for the given cell, and store the glyph string in res, terminated with ''. If resulting glyphs are longer than the provided buffer, only the first res_sz glyphs are stored. int th_render_text_mac (const thchar_t *s, thglyph_tres[], size_tres_sz, intis_decomp_am) Render the given text using Mac Thai glyph set. Parameters: s : the string to render res : the buffer for storing output glyph string res_sz : the size of res buffer is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells Returns: total number of glyphs written to res[] Calculates glyphs from Mac Thai glyph set for the given string s, and store the glyph string in res, terminated with ''. If resulting glyphs are longer than the provided buffer, only the first res_sz glyphs are stored. int th_render_text_tis (const thchar_t *s, thglyph_tres[], size_tres_sz, intis_decomp_am) Render the given text using TIS-620 glyph set. Parameters: s : the string to render res : the buffer for storing output glyph string res_sz : the size of res buffer is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells Returns: total number of glyphs written to res[] Calculates glyphs from TIS-620 glyph set for the given string s, and store the glyph string in res, terminated with ''. If resulting glyphs are longer than the provided buffer, only the first res_sz glyphs are stored. int th_render_text_win (const thchar_t *s, thglyph_tres[], size_tres_sz, intis_decomp_am) Render the given text using Thai Windows glyph set. Parameters: s : the string to render res : the buffer for storing output glyph string res_sz : the size of res buffer is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells Returns: total number of glyphs written to res[] Calculates glyphs from Thai Windows glyph set for the given string s, and store the glyph string in res, terminated with ''. If resulting glyphs are longer than the provided buffer, only the first res_sz glyphs are stored. Author Generated automatically by Doxygen for libthai from the source code. Version 0.1.14 Tue Jun 17 2014 thai/thrend.h(3)
All times are GMT -4. The time now is 05:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy