linux - 双while循环

标签 linux bash

我有一个像这样的双 while 循环:

while read file; do
  while read directory; do
    aux=$(find $directory -maxdepth 1 -type f -name "$file" | wc -l)
    if test $aux -ge 1; then
      find $directory -maxdepth 1 -type f -name "$file"
      //
    fi
  done < dir_file.txt
done < files.txt

我正在尝试在 uniq 目录中定位文件。我需要在 // 之后使用一条指令来更改 $file 与下一个指令...我尝试了 continue 但它改变了目录。

最佳答案

尝试继续2。数字参数向外计算循环次数。没有参数的 continue 等于 continue 1

关于linux - 双while循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41191755/

相关文章:

bash - 内置的 csh 'where' 的 bash 等价物是什么?

linux - 是否可以仅 grep 一列并同时打印其他 SELECTED 输出

linux - bash-script 如何将空剪贴板视为守护进程或 cron-job?

linux - 再次发送交换到内存的命令

linux - VNC4Server/vncserver – 在启动 vnc 服务器后始终使用桌面号 1

bash - aws cli - 在 bash 脚本中下载 rds postgres 日志

python - 下载后文件的可执行权限发生变化。是否有任何协议(protocol)或方法可以完好无损许可?

linux - 在linux的子目录中搜索以.txt结尾的文件

linux - 将命令的输出分配给变量

linux - 使用 bash 脚本和使用 case 语句