10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I managed to read and print variable as shown in the below code.
table_name=table1,table2,table3
i=0
IFS=","
for i in $table_name
do
echo $i
done
Is there a way how I can read more than one variable. For example I need to read 2 variables and populate the output... (6 Replies)
Discussion started by: shash
6 Replies
2. Shell Programming and Scripting
Hi,
I am trying to write a shell script to help with some digital signature work currently being undertaken where we have a file that contains a number of rows ending with ^M.
What I need to do is concatenate this using shell scripting and retain the control character. E.G.
abc^M... (5 Replies)
Discussion started by: chris01010
5 Replies
3. Shell Programming and Scripting
Hello all,
I've been out of programming for awhile so sorry about the stupid, elementary question.
I'm trying to read two inputs and compare them to a list entered as a parameter via the terminal. The script is
#!/bin/bash
read -p "Enter the numbers" NUM1 NUM2
for VALUE in $@; do
... (6 Replies)
Discussion started by: EnduranceMan
6 Replies
4. Shell Programming and Scripting
I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
Discussion started by: ccorder22
2 Replies
5. Shell Programming and Scripting
Hi,
I have an issue that hope someone will be able to help me with....
I'm using a while-read loop to read lines from a file that contain variables, and I want the variables substituted, but I can't get it to work - the below example with explain:
while read line
do
echo $line
... (5 Replies)
Discussion started by: AndyG
5 Replies
6. Shell Programming and Scripting
Hi Gurus,
I have a file named log with 2 lines
Each line is a file name. eg
$ cat log
monday
tuesday
I need to read log and assign each output(filename) to a different variable.
The following doesn't work:-
while read A B
do
echo " a is ${A} "
echo " b is ${B} "
done <... (6 Replies)
Discussion started by: wisdom
6 Replies
7. Shell Programming and Scripting
I have output from luxadm display commands as below :-
DEVICE PROPERTIES for disk: /dev/rdsk/c10t60020F200000C8083F951F4C00012863d0s2
Vendor: SUN
Product ID: T300
Revision: 0201
Serial Num: Unsupported
Unformatted capacity:... (0 Replies)
Discussion started by: lavascript
0 Replies
8. Shell Programming and Scripting
Hi I am using KSH and trying to read variables from a csv file. I've set the IFS=, and it workds. Problem is where one of the values is text containing a comma. For example the following lines exist in my file. How can I read everything between the quotes into a single variable?
APW13812,,1... (2 Replies)
Discussion started by: ventris
2 Replies
9. Shell Programming and Scripting
...
declare vINIFILE
vINIFILE=$1
...
echo "The name of the File is $vINIFILE" >>mail_tmp
echo "" >> mail_tmp.$$
...
grep RUNJOB=0 $vINIFILE >>tmp_filter
...
So the strange is in echo-statement I get the correct output for $vINIFILE wrtitten into the file mail_tmp. But the... (2 Replies)
Discussion started by: ABE2202
2 Replies
10. Shell Programming and Scripting
file.txt contains
------------------
sat1 1300
#sat2 2400
sat3
sat4 500
sat5
I need to write a shell script that will output like the below
#output
sat1.ksh 1300
sat3.ksh
sat4.ksh 500
sat5.ksh
my try
------- (4 Replies)
Discussion started by: konark
4 Replies