10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hej guys,
I am trying to read a csv file line by line, save it's fields as variables per line so I can use them as parameters and execute stuff.
I am new to shell scripting and was just strictly following a tutorial. Somehow my version seems to ignore the loop. Any help?
TY! :)
#!/bin/bash... (12 Replies)
Discussion started by: Splinter479
12 Replies
2. Shell Programming and Scripting
Hello
Just edited the entry to make it easier to understand what i want
How can i achieve this: GOAL:
read 2 field from a table with PSQL
result of this PSQL command is this
INSTALLEDLANG=$(su - postgres -c "psql -A -t -q -c -d ${DBNAME} -t -c 'SELECT code, iso_code from res_lang'")
... (0 Replies)
Discussion started by: winston6071
0 Replies
3. Shell Programming and Scripting
Hi guys,
New to the forum, and been messing around with Linux for about a year now. I'm still very much a rookie, so just assume that I'm a total idiot:
I currently have a shell that spits out a CSV number string of about 8 numbers as follows:
1.00,2.00,3.00 ... ,8.00I need to assign a... (7 Replies)
Discussion started by: hansol
7 Replies
4. 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
5. Shell Programming and Scripting
For eg: I have sample.txt file with 4 rows of record like:
user1|password1
user2|password2
user3|password3
user4|password4
The username and password is sepsrated by '|'
I want to get the 1st row value from the file and assign it to two different variables(username and password)
in my... (1 Reply)
Discussion started by: priya001
1 Replies
6. Shell Programming and Scripting
Hi,
I have requirement to assign values to variables which are created dynamically.
Below is the code which i am using to achieve above requirement.
#!/bin/ksh
oIFS="$IFS"; IFS=','
STR_FAIL_PARENT_IF_FAILS="WF_F_P_IF_FAILS1,WF_F_P_IF_FAILS2,WF_F_P_IF_FAILS3"
set -A... (1 Reply)
Discussion started by: tmalik79
1 Replies
7. Shell Programming and Scripting
Hi,
I need a simple csh script to read a file containing data like this
Buy Transactions : 175
Sell Transactions : 212
Server: sepo2
i want to read both field and its value and assign variables to each.. (2 Replies)
Discussion started by: pravsripad
2 Replies
8. Shell Programming and Scripting
Man it has been too long since I have had to do this type of stuff...
OK I have a file with lines in it looking like this:
bob:johnson:email@email.com (most lines)
john:F.:doe:email2@email.com (but some are like this)
I need to loop through and assign vars to the values:
var Fname =... (29 Replies)
Discussion started by: NewSolarisAdmin
29 Replies
9. Shell Programming and Scripting
Hello,
I have a cat.dat file, i would like shell to read each 3 lines and set this 3 lines to 3 different variables.
my cat.dat is:
11
12
+380486461001
12
13
+380486461002
13
14
+380486461003
i want shell to make a loop and assign 1st line to student_id, 2nd line to... (4 Replies)
Discussion started by: rosalinda
4 Replies
10. Shell Programming and Scripting
Is anyone able to help with writing a program that will do the following:
1. Read the contents of a file, line by line, and on each line, assign each of the two columns to a shell variable.
2. perform an action on the variables
3. Read the next line.
Here is what I've gotten so far. ... (3 Replies)
Discussion started by: akbar
3 Replies