Answers:
#!/bin/bash
names= find /home/devuser -name 'BI*'
echo $names
for name in {names[@]}
do
echo $name
var=$var$name //$ should be removed which is prefixed before var. Blank space before and after equal sign should be removed to run this code.
done
echo $var
find
的输出。然后for
是in
子句中的数组变量。
var="$(IFS=; echo "${names[*]}")"
。因此,除非您希望教问题所有者,否则更正他的多个语法错误不会有太大好处。
$
,for循环行应显示为for name in ${names[@]}