10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
need help with reading the array and sum of the array elements.
given an array of integers of size N . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large.
Input Format
The first line of the input consists of an... (1 Reply)
Discussion started by: nishantrefound
1 Replies
2. Shell Programming and Scripting
Hi I have a file with contents as below :
server | ABC Issue : File System Missing XYZ Issue : Wrong Syntax PQR Issue : Old File to be removed
Now I am looking for an o/p similar to
server <tab> ABC Issue : File System Missing
<tab> XYZ Issue : Wrong Syntax
<tab>... (4 Replies)
Discussion started by: deo_kaustubh
4 Replies
3. Shell Programming and Scripting
Hi,
I need to read a file into array and print them in a loop:-
1st file :-cat a.txt
RC1
RC2
RC3
RC4
My Program:-
#!/bin/ksh
index=0
while
do
read cnt<a.txt
print "cnt value is ${cnt}
index=`expr $index + 1`
done
Code tags for code, please. (5 Replies)
Discussion started by: satishmallidi
5 Replies
4. Shell Programming and Scripting
Hi,
I am not so familiar with bash scripting and would appreciate your help here.
I have a text file 'input.txt' like this:
2 3 4
5 6 7
8 9 10
I want to store each column in an array like this
a ={2 5 8}, b={3 6 9}, c={4 7 10}
so that i can access any element, e.g b=6 for the later use. (1 Reply)
Discussion started by: Asif Siddique
1 Replies
5. Shell Programming and Scripting
set -A title
set -A author
count=1
index=0
while
do
read -A ${title}?"Booktitle: "
read -A ${author}?"Author(s): "
(( count = count + 1 ))
(( index = index + 1 ))
done
Hi... (1 Reply)
Discussion started by: bjhum33
1 Replies
6. Shell Programming and Scripting
Hi,
I have an array like below...
Table="table1"
Table="table2"
Table="table3"
Table="table4"
.....
Table="tablen"
I want to retireve the values from the array and need to pass this to a db2 command to create a view like below.
the number of values in the array will vary
... (1 Reply)
Discussion started by: ratheeshjulk
1 Replies
7. Shell Programming and Scripting
I have this portion of a script and it works:
base_config="A B C D E"
for field in $base_config
do
var=`echo $field`
((i=$i+1))
done
I get an array of var=A, var=B, and so on.
What if I have this example with white space and want to put it into an array while... (1 Reply)
Discussion started by: djehresmann
1 Replies
8. UNIX for Dummies Questions & Answers
I have a file that is a text file, how to get all the words into and array, i am able to get each line but not each word :(.
Here is what i searched and already found...https://www.unix.com/shell-programming-scripting/99207-pipe-text-file-into-array.html.
This one reads a whole line into... (6 Replies)
Discussion started by: SasankaBITS
6 Replies
9. Shell Programming and Scripting
Hi,
I am using the following command to initialize and array
# arr=ffffff00
# echo $arr
ffffff00
my requirement is i want to fetch the one by one character from array.
I don't know how to fetch one by one charcter from array.
Please i need an help.
Thank you very much
Ravi R N (2 Replies)
Discussion started by: ravi_rn
2 Replies
10. UNIX for Dummies Questions & Answers
Hi
I have something like
cat $HOME/all_dirs | while read ln_old_dirs
do
if
then
echo "$ln_all_old_dirs"
fi
done
As you know that the variable ln_all_old_dirs is not accessable from outside the... (2 Replies)
Discussion started by: ssuresh1999
2 Replies