Thread wtmp Log-Washer Script: Klitzekleine Hilfe plz? :) (11 answers)
Opened by FlorianL at 2007-06-11 16:26

FlorianL
 2007-06-12 11:46
#77452 #77452
User since
2007-05-18
142 Artikel
BenutzerIn
[default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
my $date = `date`;
my @cdate = split(/ /, $date);
my $cmonth = mapmonth($cdate[1]);
my $delstart = ($cmonth - 2);
my $delstop = ($cmonth + 1);
my @range = ($delstop .. $delstart);

[...]

if ($monthnr != @range)  {
open(NEWWTMP,">>$newwtmp");
print NEWWTMP $_;
}


Ich bekomme keine fehlermeldung aber es funzt auch nicht (hab ich mir fast gedacht aber ich wusste nich wie ichs "mal eben" zustandebring, und perldoc -q compute.*difference bringt mich gerad auch nich weiter :(

renee, wann stehste auf? *ggg*


edit:

Code: (dl )
1
2
3
4
my $okaymonth1 = ($cmonth - 2);
my $okaymonth2 = ($cmonth - 1);

if (($monthnr eq $cmonth) or ($monthnr eq $okaymonth1) or ($monthnr eq $okaymonth2))



geht zwar, is aber irgendwie hässlig, wie gehts besser?

edit2:

mir fällt gerad auf das ich dann im januar/februar probleme bekommen werde...

hmmm

edit3 (hoffentlich wars das dann *g*):

Code: (dl )
1
2
3
4
5
6
if ($okaymonth1 == '-1') {
       $okaymonth1 = '12';
}
if ($okaymonth2 == '-2') {
       $okaymonth2 = '11';
}

lösung okay oder wie sollte ich das problem besser umgehn?

---
Modedit Gwendragon: +CODE
---\n\n

<!--EDIT|GwenDragon|1181643556-->

View full thread wtmp Log-Washer Script: Klitzekleine Hilfe plz? :)