Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我Dirlist=$(find $1 -type d)用来获取作为$1参数给出的目录的子目录列表,但我需要从Dirlist列表的第一个元素(目录$1本身)中删除。有人可以告诉我我该怎么做,好吗?
Dirlist=$(find $1 -type d)
$1
Dirlist
您可以添加-mindepth 1选项:
-mindepth 1
find $1 -mindepth 1 -type d