Quote:
Originally Posted by vgersh99
Code:
#!/bin/ksh
list='201,204,301'
IFS=,; set -A array ${list}
typeset -i i=0
while (( $i < ${#array[*]} ))
do
echo "${array[$i]}"
((i=i+1))
done;
|
I'm using Bash which doesn't have -A option for set and, from what I can tell, doesn't have an equivalent. I wish it did because you basically do what I need in a single line with your example.
For now I've solved my problem this way:
Code:
while [ "$1" != "" ]; do
case $1 in
-p ) shift
case $1 in
*,* ) pools=( $(for i in $(eval echo {$1}); do echo $i; done | sort) ) ;;
* ) pools=$1 ;;
esac
;;