10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Gurus,
I have a script which assign awk output to shell variable. current it uses two awk command to assign value to two variables. I want to use one command to assign two values to two variables. I tried the code, but it does't work. kindly provide your suggestion.
current code... (2 Replies)
Discussion started by: green_k
2 Replies
2. Shell Programming and Scripting
Hello,
I am using below code for reading from a file and assigning the values to a variable , but it is loosing the value after the loop , please suggest to retain the value of the variable after the loop ,
while IFS=: read -r line
do
set $dsc=$line
echo 'printing line variable ' $line... (1 Reply)
Discussion started by: ParthThakkar
1 Replies
3. Shell Programming and Scripting
I am trying to read a input file which has two columns separated by space
Input file
server1 server2
server3 server4
server5 server6
When i execute the below while code it reads line by line and a and b variables are able to successfully fetch the values
while read a b
do
echo "$a"
echo... (5 Replies)
Discussion started by: chidori
5 Replies
4. Shell Programming and Scripting
Hi
As bash does not support multidimensional arrays (?), I need some help with a problem. What I want to do is to assign variable names containing a counter in a loop .
what I want to do is basically something like this:
#!/bin/bash
for i in {1..8}; do
var$i = "some command"
done... (6 Replies)
Discussion started by: Tobbev
6 Replies
5. UNIX for Dummies Questions & Answers
Hi i have one variable like DIR="f1 f2" in config file
in my script i have one runtime variable LFILE="DIR"
now i want to use $DIR in my script by using LFILE that is i dont want to use DIR dirctly i am extracting DIR by some other means.
Config file : DIR="f1 f2"
Script:
LFILE="DIR"
i... (3 Replies)
Discussion started by: sriram_gec
3 Replies
6. UNIX for Advanced & Expert Users
Hi,
I have a text file with multiple lines, each having data in the below format <DOB>,<ADDRESS>
I have to write a script which reads each line in the text file in loop, assign the values to these variables and do some further processing in it.
Using the following code prints the values... (12 Replies)
Discussion started by: manishab00
12 Replies
7. Fedora
Hi,
I have a text file with multiple lines, each having data in the below format
<DOB>,<ADDRESS>
I have to write a script which reads each line in the text file in loop, assign the values to these variables and do some further processing in it.
Using the following code prints the... (1 Reply)
Discussion started by: manishab00
1 Replies
8. Shell Programming and Scripting
Hi Masters,
I want to assign the values of one variable to another variable.
Here the varaible name 'var' is dynamic. I know the values of V_2 and U_3, but
If the i/p of TYPE is 'U' and the NO is 3, then I want to assign the values of
U_3 to var.
How we can achieve it?
TYPE="U"... (4 Replies)
Discussion started by: ecearund
4 Replies
9. Shell Programming and Scripting
I have a csv file with the values seperated by commas.I want to extract these values one by one and assign to a variable using shell script.Any ideas or code? (11 Replies)
Discussion started by: rajbal
11 Replies
10. Shell Programming and Scripting
i have a file in this format
curyymm PRVYYMM CDDMmmYY bddMmmyy eddMmmyy
--------- ------- ------------ ---------- -----------
0906 0905 09Jun09 01Jun09 30Jun09
----------- --------- ------------ ------------ -----------
i need to read the... (5 Replies)
Discussion started by: depakjan
5 Replies