How to recursively list subdirectories in Bash without using “find” or “ls” commands?

前端 未结 10 2136
情歌与酒
情歌与酒 2020-12-01 17:22

I know you can use the find command for this simple job, but I got an assignment not to use find or ls and do the job. How can I do th

10条回答
  •  醉酒成梦
    2020-12-01 17:51

    Technically, neither find nor ls are used by find2perl|perl or File::Find directly.

    $ find2perl -type d | perl
    $ perl -MFile::Find -e'find(sub{-d&&print"$File::Find::name\n"},".")'
    

提交回复
热议问题