Thread: Theres a problem i cant solve
Results 1 to 5 of 5
Related
-
Solve Traffic Problems. TE&Networking With A New Twist Forum: Internet Services
Replies: 0 -
A really simple problem - but I can't solve it! Forum: HTML Forum
Replies: 1
-
09-27-2002, 09:03 AM #1
Theres a problem i cant solve
opendir(ETC,"/home");
while ($name = readdir(ETC)){
if ($user eq $name){
print("<font color=red><b><BR><BR>$user");
print("</b><BR><BR>");$disk=exec"du -s /home/$user");
print("</b><BR><BR>");
}
}
print ("</BODY></HTML>");
closedir(ETC);
My unix is telling me there is a problem with this but i cant find it if some one can tell me where it is my program will be finished i also want the program to print just $disk=exec"du -s" but it also comes up with the directory name too how can i remove it
-
09-27-2002, 11:58 AM #2
I think Enigma has a lot of experience with Perl, Enigma, any thoughts?
If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
09-30-2002, 10:13 AM #3
What is the error message/problem that you're getting when you try to run this?
-
04-20-2004, 02:10 PM #4
regex is your answer, something like...
use du -Sh (h will show the value in a more readable format and S shows a summary.
regex just before you print the value to screen will strip out the directory:
$user =~ s/$user//g;
and you may need at the start of the loop:
next if $user eq '.';
-
04-20-2004, 02:13 PM #5
oh iand rather than doing:
if ( $name eq $user ) {
do:
if ( $user =~ /$name/ ) {
cos it might not be exact.
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum