10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
2. Shell Programming and Scripting
Hi,
I need to assign values from a lines in a file into variables in unix, i am using Korn shell.
I tried the below script from posts but i am unable to fetch every value in a variable.
#! /usr/bin/ksh
#for file in test.txt; do
IFS=$'\|'
I=1
while read -a val
do
echo... (15 Replies)
Discussion started by: karthikram
15 Replies
3. Shell Programming and Scripting
Hi! This might be a simple thing, but I'm struggling to assign values to variables from the file.
I've the following values stored in the file.. It consists of only two rows..
10
20
I want to assign the first row value to variable "n1" and the second row value to variable "n2"..
That is ... (3 Replies)
Discussion started by: abk07
3 Replies
4. Shell Programming and Scripting
Hi,
I have a config file that has blank, commented lines. I need to escape commented lines, blank lines, parse the remaining lines and store them in variables or array.
the config file contains the following lines.
# config file
# Define Oracle User
ORA_USER=abcde
ORA_PASS=xyzabc... (8 Replies)
Discussion started by: Lakshmi Chowdam
8 Replies
5. Shell Programming and Scripting
Hi,
I have a file like the following...
CUST=
DIR=
NULIST=
name=philps_123
How can i add values to each of these unassigned variables using a shell script?
say for eg: i have values for CUST as onida, dir as /dir/onida, NULIST as /tmp/onida_files. How can i add these values to... (11 Replies)
Discussion started by: Tuxidow
11 Replies
6. Shell Programming and Scripting
Hi,
I want to read the variables and the values from the txt file and compare these values with the ones computed by script.
for ex:
say var.txt contains the variable names and their values:
one 1
two 2
three 3
The value of variables "one" "two" and "three" will be computed in the script... (3 Replies)
Discussion started by: bhushana
3 Replies
7. Shell Programming and Scripting
Hi,
I was trying to do something where I would be able to export one local variable in a telnet subshell to its parent shell.
I found something like this over here, but couldnt exactly understand it :(.
I am referring to this part actually:
#! /usr/bin/ksh
exec 4>&1
tail -5 >&4 |&
exec... (4 Replies)
Discussion started by: King Nothing
4 Replies
8. Shell Programming and Scripting
The text file has one single row and looks like this
Q1 P1 2006
I have to pick up this values from a shell script into three different variables,
say quarter, period and year from the above text file. Some one know's how to do this? I went through 'sed', dint really know how to... (3 Replies)
Discussion started by: sarsani
3 Replies
9. Shell Programming and Scripting
Hello,
I've been struggling with this for some time but can't find a way to do it and I haven't found any other similar thread.
I'd like to get the 'fields' in a line from a file into variables in just one command.
The file contains data with the next structure:... (4 Replies)
Discussion started by: semaler
4 Replies
10. Shell Programming and Scripting
Hi, i've got an executable shell script, called mysc.sh with this line only:
export DATASIZE=0
i run it from my console (./mysc.sh), and after that in the console i run:
echo $DATASIZE
and nothing prints
what could be the problem???
thanks!! (2 Replies)
Discussion started by: kfad
2 Replies