如何使bash查找在同一进程中运行?
代码优先如何使bash查找在同一进程中运行?,bash,find,Bash,Find,代码优先 echo $$ - $BASHPID find . | while read -r file; do echo $$ - $BASHPID: ${file} done 问题是中的代码在子进程中运行。如何在同一流程中运行此功能?只需使用: echo“$$-$BASHPID” 读取-r文件时;做 echo“$$-$BASHPID:${file}”#最好引用! 完成< echo "$$ - $BASHPID" while read -r file; do echo "$
echo $$ - $BASHPID
find . | while read -r file; do
echo $$ - $BASHPID: ${file}
done
问题是中的代码在子进程中运行。如何在同一流程中运行此功能?只需使用:
echo“$$-$BASHPID”
读取-r文件时;做
echo“$$-$BASHPID:${file}”#最好引用!
完成<
echo "$$ - $BASHPID"
while read -r file; do
echo "$$ - $BASHPID: ${file}" #better to quote!
done < <(find .)
# -----^^^^^^^^^