10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: ce9888
5 Replies
2. UNIX for Advanced & Expert Users
This question is for someone that's more familiar with Array Element.
I need to know if the maximum array element that can be assigned is 1024 and if its so, Is there a workaround solution when the counter exceeded 1024?
param_array="$param_nam"
counter=$counter+1
#to avoid space... (3 Replies)
Discussion started by: cumeh1624
3 Replies
3. Shell Programming and Scripting
Hi, I have an ksh array(ARR). the elements to the array are file names. i need to go to each file in the array and manipulate the records.
for name in ${files}; do ---this loop is for all the file names in the array
for i in $(wc -l < $name); do --this loop is for all the records in... (20 Replies)
Discussion started by: usrrenny
20 Replies
4. Shell Programming and Scripting
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)
Discussion started by: kkabc789
2 Replies
5. Shell Programming and Scripting
Hi,
I have:
# Initialize variables
#!/usr/bin/ksh
FILENM=$1
INDEX=0
# read filename
echo "You are working with the Config file: $FILENM"
while read line
do
echo $line
data=$line
((INDEX=INDEX+1))
done <"$FILENM" (3 Replies)
Discussion started by: Marc G
3 Replies
6. Shell Programming and Scripting
Hi all,
I need help with the following scenario in ksh.
If the number of elements contained by arrayA is 11 I need to insert a zero as the element arrayA then print all arrayA elements separated by comma.
Appreciate your help. (9 Replies)
Discussion started by: ejianu
9 Replies
7. Shell Programming and Scripting
I am trying to take all the elements of an array and multiply them by 2, and then copy them to a new array. Here is what I have
i=0
for true in DMGLIST
do
let DMGSIZES2="${DMGSIZES}"*2
let i++
done
unset i
echo ${DMGSIZES2}
It does the calculation correctly for the first element,... (7 Replies)
Discussion started by: nextyoyoma
7 Replies
8. Shell Programming and Scripting
Hi
I'm trying to create an array with variable including hyphen
but ksh refuses the first element
set -A allArgs
set +A allArgs ${allArgs} -all
set +A allArgs ${allArgs} -date
set +A allArgs ${allArgs} test
./test.ksh: -all: bad option(s)
It happens only when first element is like... (4 Replies)
Discussion started by: gdan2000
4 Replies
9. Shell Programming and Scripting
All,
I would like to add the first 10 elements of an array. Here is how I am doing it now (only included first few add ops):
#!/usr/bin/ksh
###Grab the array values out of a file###
TOTAL=`awk '/time/' /tmp/file.out | awk '{print $4}'`
set -A times $TOTAL
SUM=$((${times} + times... (3 Replies)
Discussion started by: Shoeless_Mike
3 Replies
10. Shell Programming and Scripting
Hello everyonel,
I have an array set like so
num=4
read name
arr=name
I go through while loop to assign different values to different array element from 1 to 4. when I try to access the FIRST element of the array I get the last one first. Like if I say ${arr} it will show the last element... (4 Replies)
Discussion started by: afadaghi
4 Replies