bash制御構文
Posted: | Categories: bash | Tags: bash, 制御構文
分岐
if [ 条件 ] ; then
fi
if [ 条件 ] ; then
else
fi
if [ 条件 ] ; then
elif [ 条件 ] ; then
fi
declare -i i=0
while [ "$i" -lt 5 ]; do
# 処理
((++i))
done
for 文
declare -i i
for ((i=0; i < 5; ++i)); do
done
for each 文
for field in "${fields[@]}";do
done