I have a shell script that uses 'read' to populate an array element
by element. However, if my array is named "array" and I'm reading
into index X, and there is a file in the current working directory
called "arrayX", it malfunctions. I've reduced it to the following
test case:
#!/bin/ksh
rm -f list0 2>/dev/null
unset list
set -A list
echo foo | read list[0]
echo "list[0]: ${list[0]}"
echo "list0: ${list0}"
touch list0
unset list
set -A list
echo foo | read list[0]
echo "list[0]: ${list[0]}"
echo "list0: ${list0}"
Which emits:
list[0]: foo
list0:
list[0]:
list0: foo
I'm baffled.
Dave