Re: [問題] 如何找出所有的leaf directories?
#!/usr/bin/perl -w
&dfs('/home/user');
sub dfs{
my $dic = shift;
my $leaf = 1;
for(<$dic/*>){
$leaf = &dfs($_) if(-d $_);
}
print "$dic\n" if($leaf);
0;
}
※ 引述《jawdc1129 (everest)》之銘言:
: 請問一下, 要如何找尋一個系統下的所有leaf directories?
: 比如說在 unix /home/user 下找出所有 leaf directories 的名字並把它列印出來
: 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.248.4.112
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Perl 近期熱門文章
PTT數位生活區 即時熱門文章