标签: bashism

linux shell: for arg; do

Reading LTP shell code it uses strange for loop syntax:

for arg; do
    TCID="${TCID}_$arg"
done
Run Code Online (Sandbox Code Playgroud)
  1. How does it takes arguments? I'd expect it loops over $arg, separating with $IFS, but when trying $ arg="aa bb"; for arg; do echo $arg; done and it prints nothing.
  2. Is it a bashism?

bash posix for-loop sh bashism

3
推荐指数
1
解决办法
613
查看次数

标签 统计

bash ×1

bashism ×1

for-loop ×1

posix ×1

sh ×1