【发布时间】:2014-07-14 20:38:23
【问题描述】:
标题应该说明一切,如果没有让我知道,我会更新问题。
代码
TYPE=('html?' 'jsp' 'php')
TYPE=$(printf "|%s" "${TYPE[@]}")
## will not except paths with spaces
for file in $(find -E * -type f -iregex ".*(${TYPE:1})") ; do
echo $file
done
在尝试包装时
## command substitution: line ~: syntax error near unexpected token `('
## command substitution: line ~: `find -E * -type f -iregex \".*(${TYPE:1})\")"'
for file in "$(find -E * -type f -iregex \".*(${TYPE:1})\")" ; do
echo $file
done
【问题讨论】: