Tokenize a string in KornShell
I need to tokenize in string in KornShell (ksh). I have got the following script for bash; but it does not seem to work in ksh.
The script is below. Please help in making work for ksh.
OLDIFS=$IFS
IFS=","
read -a array <<< "$(printf "%s" "$APPLICATION_NAMES")"
IFS=$OL开发者_如何学编程DIFS
for i in "${array[@]}"
do
:
# do whatever on $i
echo "Checking status of $i"
done
# s=a,b,c
# IFS=,
# set -A arr $s
# for e in "${arr[@]}"; do print -- "$e"; done
a
b
c
精彩评论