我需要在KornShell(ksh)中用字符串标记。我有bash的以下脚本;但它似乎不适用于ksh。
脚本如下。请帮助为ksh工作。
OLDIFS=$IFS
IFS=","
read -a array <<< "$(printf "%s" "$APPLICATION_NAMES")"
IFS=$OLDIFS
for i in "${array[@]}"
do
:
# do whatever on $i
echo "Checking status of $i"
done
答案 0 :(得分:2)
# s=a,b,c
# IFS=,
# set -A arr $s
# for e in "${arr[@]}"; do print -- "$e"; done
a
b
c