私はBashバージョン4.2.25を実行しています。ここに私のコードです:
#!/usr/bin/env bash
string="one:two:three:four"
# without quotes
IFS=: read -ra array_1 <<< $string
for i in "${array_1[@]}"; do printf "i = [$i]\n"; done
# output:
# i = [one two three four]
# with quotes
IFS=: read -ra array_2 <<< "$string"
for i in "${array_2[@]}"; do printf "i = [$i]\n"; done
# output:
# i = [one]
# i = [two]
# i = [three]
# i = [four]
どのような動作の違いについて説明しますか?
これは実際には4.3で部分的に取り上げられ、4.4で完了したバグです。 – chepner