perlquestion
Panasonictoilet
Hello fellow monks,
<br><br>
I am trying to write a script that goes through home directories and does a du but excludes stuff in specific Maildir directories, cur, new, tmp and courierimapkeywords. I have tested it on the commandline and I have it in my perl script as below:
<br><br>
$du=`du -ch $homedir | grep -v '^.*Maildir.*cur$' | grep -v '^.*Maildir.*tmp$' | grep -v '^.*Maildir.*new$' | grep -v '^.*Maildir.*courierimapkeywords$'`;
print $du;
<br><br>
However this does not work and is giving me the following errors:
<br><br>
du: cannot access `~skim': No such file or directory
sh: .*Maildir.*tmp: not found
sh: .*Maildir.*courierimapkeywords: not found
<br><br>
I have used backticks before for simple operations but is this too complicated for backticks, or do i need to escape certain character out, if so how??
<br><br>
Please help enlighten me fellow monks!