hi all, its me again!!! i've requirement like this:
i want to create a file & an array with its name having the filename as its substring. here is the test script!!
#!/bin/bash
touch $1
declare -a $1_rec;
echo -n "$1_rec[1]: "
read $1_rec[1];
echo $[$1_rec[1]];
now see output:
this is when i enter only numeric value:
$./ex3 hell
hell_rec[1]: 45
45
when entered string or char.:
$ ./ex3 hell
hell_rec[1]: boy
0
entered alphanumeric string with number first:
$ ./ex3 hell
hell_rec[1]: 45ex
./ex3: line 6: 45ex: value too great for base (error token is "45ex")
entered alphanumeric string with char. first:
$ ./ex3 hell
hell_rec[1]: ex45
0
i actually wanted the value entered to redirect into the file.
thanks in advance!
regards
prayush