The way I've been using arrays currently have been:
#!/bin/ksh
set -A myArray
myArray=value1
myArray=value2
myArray=value3
myArray=value4
Is there a way I can assign values to an array that will automatically place the value into the next element in the array like:
myArray=value1... (4 Replies)
I have to add a variable value to an array, something like this:
......
@my_array_name = $value_of_this_variable;
This doesnt seem to work, any ideas why?
Thanks! (4 Replies)
I need to do something like this:
for i in 1 2 3 4 5; do
arr=$(awk 'NR="$i" { print $2 }' file_with_5_records)
done
That is, parse a file and assign values to an array in an ascending order relative to the number of record in the file that is being processed on each loop.
Is my... (2 Replies)
Hello,
Can somebody please give me a snippet for the below requirement.
I want to assign the values separeted by a comma to be assigned to a dynamic array.
If I give an input (read statement) like abc1,abc2,abc3,abc4,abc5, all these strings abc* should be assigned to an array like below... (2 Replies)
set -A matched #find referenced files.
for i in ${file_names_html}
do
counter_j=0
for j in ${file_names_minus_index}
do
match=`cat $i | grep... (1 Reply)
hi
My script as below
#!/bin/ksh
for i in `seq 1 7`
do
a=$(awk '{print $i}' /home/rama/expenese.txt)
done
for i in `seq 1 7`
do
echo "${a}"
done
content of expense.txt is as below
5032 210179 3110 132813874 53488966 11459221 5300794
I want output as... (6 Replies)
Hi ,
i have file which is having two fields in it (#delimited)
ABC#FILE_01.DAT
DEF#FILE_02.DAT
i want to write first field values to one array example A_01 and second field values to B_02 array
please let me know how to do this ,my final requirement i have send out a mail for each record... (2 Replies)
I want to extract each and single character from a password string and put it in an array.
I tried this :
set -A password "echo $passwd | awk '{for (i=1; i<=length($1); i++) printf "%s ",substr($1,i,1)}'`
It's working as long that the password string doesn't contains any *
I tried a few... (5 Replies)
Hi,
I have the following code that makes use of a URL that I store in a variable then create a document object below to work on it.
$dom = new DOMDocument;
@$dom->loadHTML($html);
$links = $dom->getElementsByTagName('a');
$links = $dom->getElementsByTagName('a');
... (0 Replies)