10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am trying to write a Bash Script using a couple of arrays. I need to perform a countdown of sorts on an array done once daily, but each day would start with the numbers from the previous day. This is what I'm starting with :
#!/bin/bash
days=(9 8 7 6 5)
for (( i = 0 ; i < ${#days} ; i++... (4 Replies)
Discussion started by: cogiz
4 Replies
2. UNIX for Dummies Questions & Answers
I'm trying to run some computations on a cluster and have found that a bsub array is what I need.. So I tried running a simple example I found
bsub -J "myArray" echo "Job \$LSB_JOBINDEX"
This should create 10 jobs that output "Job 1" "Job 2" .. etc. But when I run this from afs space I get... (1 Reply)
Discussion started by: ehj
1 Replies
3. Shell Programming and Scripting
I am trying to map values in the input file, where 2nd column depends on the specific value in the 1st column. When 1st column is A place 1 into 2nd column, when it is B, place 2, when C place 3, otherwise no change.
My input:
U |100|MAIN ST |CLMN1|1
A |200|GREEN LN |CLMN2|2
1 |12... (4 Replies)
Discussion started by: migurus
4 Replies
4. Shell Programming and Scripting
i have a variable MYHOST that has my host name.depending on the host i have an array like A_<hostname>.Everytime i need to append the hostname to A_ to get the array.but in the shell script i am nt able to access the members of that array.
code of what i hav done:
export temp=A_$MYHOST
for... (15 Replies)
Discussion started by: niteesh_!7
15 Replies
5. Programming
i have no idea how to make a text file
abc efg
hij klm
nop qrs
to be a array such as, arr to be "abc efg" arr "hij kml" etc..... in C (2 Replies)
Discussion started by: tyckelvin1
2 Replies
6. Programming
Hi All,
I am using the array of pointers and storing the address of string.This is a global list.
So i am using extern to give the reference of this list to another file and using reading the data from this string.
But list is being corrupted and string is missing some characters in... (2 Replies)
Discussion started by: lovevijay03
2 Replies
7. Shell Programming and Scripting
hi friends.,
i have two files yy.dat and mm.dat containing 110 elements in each
if i read them into variables it is just showing only 4 elements instead of 110 elements
My script is like this
##################################
/bin/bash
declare -a yy=(`cat yy.dat`)
echo "No of values in... (1 Reply)
Discussion started by: yagnesh
1 Replies
8. Shell Programming and Scripting
I am using /bin/ksh for this problem.
I have created some arrays with variable names as the array names:
cnt=1
{ while read myline; do
tempmeas="${meas%%;*}"
cto="${meas#*;}"
tempstream=$stream
# wholemeas holds the name of the array
# each array name... (0 Replies)
Discussion started by: ajgwin
0 Replies
9. Shell Programming and Scripting
hi,
I get a *.dat files list in an array using:
array=($(find . -name "*.dat"))
the problem is that when a filename contains spaces, each space-separated token of the filename is in a different element of array.
For instance if I have:
x@x:~/tmp$ ls *.dat
test1.dat test 2.dat ... (1 Reply)
Discussion started by: jul
1 Replies
10. Shell Programming and Scripting
Dear Experts,
please help me out once again my array concepts is not very clear i have one text file like.
1|usa|hh
2|usa|ll
3|usa|vg
4|uk|nn
5|uk|bb
6|kuwait|mm
6|kuwait|jkj
7|dubai|hh
i want to store the third fied of a text file in he array and after that it should give me some... (6 Replies)
Discussion started by: shary
6 Replies