Sponsored Content
Top Forums Shell Programming and Scripting ksh help assigning specific values to variable in script Post 302402689 by frustrated1 on Wednesday 10th of March 2010 11:05:14 AM
Old 03-10-2010
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:
Code:
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 the file I would expect something like the below
Code:
a=Customer1,b=4500,c=8000
a=Customer2,b=6422,c=8922

and so on...

I want to be able to do this in a ksh script - any ideas ? SmilieSmilieSmilie

Last edited by Scott; 03-10-2010 at 12:56 PM.. Reason: Code tags please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

assigning values to a variable

i try to get the year and month values using the below shell script when i enter the script like this #!/usr/bin/ksh dd=`DATE +%Y%M` echo $dd it is showing the error as shown below abc.ksh: DATE: not found any suggestions please (3 Replies)
Discussion started by: trichyselva
3 Replies

2. Shell Programming and Scripting

problem assigning values to variable

Date of Request: 20080514 10:37 Submitted By: JPCHIANG i want to get the value "JPCHIANG" only in read a file, however, when i do this: name=`"$line"|cut -d " " -f8` it display all the line and append 'not found' at the end of the statement the $line is actually a variable in a... (2 Replies)
Discussion started by: finalight
2 Replies

3. Shell Programming and Scripting

Assigning multiple values to a variable

Hi Guru`s, I have to write a prog. which will traverse through diff. directories and then extract some data from files. I have written it and its working fine. But I have tested it in 1 folder. There are many folders and I need to loop through each of them. I am not sure abt the... (4 Replies)
Discussion started by: unx100
4 Replies

4. 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

5. Shell Programming and Scripting

Assigning a set of values to a variable

I wnat to assign a set of values to a variable and use it in if condition. for example: i=$1 d=1 2 3 4 5 6 if then echo "Fine" else echo "Check" fi i will either of the value in d, i.e. i can be 1 or 2 or any value in d, How this can be done? Thanks in advance (2 Replies)
Discussion started by: sol_nov
2 Replies

6. Shell Programming and Scripting

help with assigning multiple values to a variable

I have a situation where my variable needs to pick up any of the 4 values from the environment it is in for e.g i am on server named a server=a (script running on this server) ftp servers= b c d e ----- the parameter passed should be any of these values in these 4 values, if not throw an... (4 Replies)
Discussion started by: dsravan
4 Replies

7. Shell Programming and Scripting

[Solved] Assigning a value to a variable name then running a loop on these values

Hi, I was wondering if anyone could assist me for (what is probably) a very straightforward answer. I have input files containing something like File 1 Apples Apples Apples Apples File 2 Bananas Bananas Bananas Bananas (4 Replies)
Discussion started by: hubleo
4 Replies

8. Shell Programming and Scripting

Assigning numeric values to variable

I have a code like this v_num=9 comp_num=39 if then echo "pass" fi echo "end" I am getting an error ksh: v_num=99 comp_num=39 if then echo "pass" fi echo "end" (3 Replies)
Discussion started by: swayam123
3 Replies

9. Shell Programming and Scripting

Assigning Column Values to ARRAY in ksh

Hi , i have file which is having two fields in it (#delimited) ABC#FILE_01.DAT DEF#FILE_02.DAT i want to write first field values to one array example A_01 and second field values to B_02 array please let me know how to do this ,my final requirement i have send out a mail for each record... (2 Replies)
Discussion started by: kkabc789
2 Replies

10. Shell Programming and Scripting

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: printf "Enter account names: " BILL JOHN SARA JILL read input (9 Replies)
Discussion started by: seekryts15
9 Replies
STRCTLSZ(5)							File Formats Manual						       STRCTLSZ(5)

NAME
STRCTLSZ - maximum size of streams message control (bytes) VALUES
Failsafe Default Allowed values Recommended values DESCRIPTION
limits the maximum number of bytes of control data that can be inserted by in the control portion of any streams message on the system. If the tunable is set to zero, there is no limit on how many bytes can be placed in the control segment of the message. returns if the buffer being sent is larger than the current value of Who Is Expected to Change This Tunable? Any customer. Restrictions on Changing Changes to this tunable take effect at next reboot. When Should the Value of This Tunable Be Raised? The tunable should be increased by any customer if the customer's STREAMS module/driver(s) require more bytes in the control portion of any streams message than the current value. What Are the Side Effects of Raising the Value of This Tunable? The kernel will use more memory. During low memory situations, it may bring down system performance due to frequent swapping. When Should the Value of This Tunable Be Lowered? The tunable could be lowered by any customer if the customer's STREAMS module/driver(s) do not require a longer message size in the control portion than the current value. What Are the Side Effects of Lowering the Value of This Tunable? Possible improper functioning in any of the STREAMS module/driver(s). Possible performance degradation, particularly in networking. What Other Tunable Should Be Changed at the Same Time as This One? None. WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. Tunable Kernel Parameters STRCTLSZ(5)
All times are GMT -4. The time now is 07:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy