Wednesday 20.03 at 10:17, Catalin Florin RUSSEN wrote:
# Salutare,
#
# Nu prea am eu mari idei depre perl (invat in momentul de fata), dar
# vreau sa fac o chestie si am nevoie de ajutor (pana pun muschiu' cu
# perlu', iar un exemplu cat de cat functional mi-ar prinde tare bine).
# Vreau sa fac un script care sa stearga fisiere mai vechi de x zile,
# sintaxa s fie de genul:
# remove [x-zile] [/cale/catre/fisiere] [tip.de.fisiere]
# ca sa dau un exemplu: remove 10 /var/spool/dbtmp *.dmp - sa stearga
# toate fisierele .dmp mai vechi de 10 zile din /var/spool/dbtmp .
#
# Multzam fain pentru orice ajutor.
#!/usr/bin/perl
# remove.pl zile director glob (file mask)
chdir($ARGV[1]); for(<$ARGV[2]>) {
unlink if((time()-(stat("$ARGV[1]/$_"))[9])>86400*$ARGV[0])
}
# Piratu'
--
Radu <[EMAIL PROTECTED]> www.littledragon.f2s.com
It is the weak who are cruel, only the strong can be truly gentle.
---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to
unsubscribe from this list.