为什么这不起作用?
find . -maxdepth 1 -type f -print0 | xargs -0 .
Run Code Online (Sandbox Code Playgroud)
我得到的只是xargs: .: Permission denied
.
Mat*_*Mat 15
当你运行时. file
,你调用一个内置的shell .
.您的xargs
变体尝试执行当前目录.
即使它确实调用了内置函数,该命令也会在子shell中运行,因此所有"采购"都将毫无用处.
使用shell globbing和一个循环:
for file in * ; do
if [ -f "$file" ] ; then
. "$file"
fi
done
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4276 次 |
最近记录: |