O'Reilly logo
  • QIAN Weishuo thinks this is interesting:

oldIFS=$IFS IFS=, # IFS is now a , for item in $data; do echo Item: $item done

From

Cover of Linux Shell Scripting Cookbook - Third Edition

Note

$IFS 的值能改变 for循环的逻辑;循环变量将按照指定的IFS切开遍历