나는 direcory의 크기를 얻기 위해 perl 스크립트를 통해 유닉스 명령을 실행하고 있습니다.perl 스크립트에서 유닉스 명령의 실행 값을 얻으십시오.
$path = "/dir1/di2/";
system("du -sh $path");
어떻게 필자의 펄 스크립트로 결과를 얻을 수 있습니까? 내가
$size = system("du -sh $path");
print $size
을 사용하고 그러나 크기 = 0을주고있다
;
-1 [Perl FAQ] (http://faq.perl.org) : [시스템()으로 명령 출력을 얻을 수없는 이유는 무엇입니까?] (http : // learn.perl.org/faq/perlfaq8.html#Why-cant-I-get-the-output-of-a-command-with-system-) – daxim