#!/bin/bash # 遍历当前目录下的所有目录 for dir in ./*/ ; do # 检查output子目录是否存在 if ! [ -d "$dir/output" ]; then # 打印不含output子目录的目录名 echo "${dir:2:-1}" fi done