bash – “<((cmd args)”是什么意思在shell中?
发布时间:2020-12-15 18:25:39 所属栏目:安全 来源:网络整理
导读:当循环遍历具有包含空格的文件夹的文件夹时,我使用的 shell脚本是从 internet复制的: while IFS= read -r -d $' ' file; do dosomethingwith "$file" # do something with each file done (find /bar -name *foo* -print0) 我觉得我懂了IFS的一点,但是我不
当循环遍历具有包含空格的文件夹的文件夹时,我使用的
shell脚本是从
internet复制的:
while IFS= read -r -d $' ' file; do dosomethingwith "$file" # do something with each file done < <(find /bar -name *foo* -print0) 我觉得我懂了IFS的一点,但是我不明白’ <(...)'字符意味着.显然,这里有一些管道. Google很难“”,“你看.
<()在手册中称为
process substitution,与管道类似,但传递形式为/ dev / fd / 63的参数,而不是使用stdin.
<从命令行中命名的文件中读取输入. 这两个运算符一起工作就像管道一样,因此可以重写为 find /bar -name *foo* -print0 | while read line; do ... done (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |