Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Sistemi operativi I > esercizi di shell
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Chobeat
.illuminato.

User info:
Registered: Sep 2007
Posts: 241 (0.04 al dì)
Location: Alessandria
Corso: Informatica
Anno: 1
Time Online: 1 Day, 6:13:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
esercizi di shell

Trovare tutti i file modificati di venerdì (sia un venerdì particolare che di venerdì in generale)


come diamine si fa? cioè io il time stampato direttamente con il nome del giorno senza la -printf di find non riesco a farla e su minix, find non ha -printf. con ls formatta malissimo e non riesco a isolare a dovere la data e poi anche quando ce l'ho come tiro fuori il giorno? con date? e se si, come?

02-07-2010 22:35
Click Here to See the Profile for Chobeat Click here to Send Chobeat a Private Message Find more posts by Chobeat Add Chobeat to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Deckard
.illuminato.

User info:
Registered: Sep 2008
Posts: 242 (0.04 al dì)
Location: ~
Corso: Info
Anno: primo
Time Online: 3 Days, 17:53:20 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

stat -Mtime

__________________
And all those moments will be lost in time, like tears in rain...

02-07-2010 22:40
Click Here to See the Profile for Deckard Click here to Send Deckard a Private Message Find more posts by Deckard Add Deckard to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Chobeat
.illuminato.

User info:
Registered: Sep 2007
Posts: 241 (0.04 al dì)
Location: Alessandria
Corso: Informatica
Anno: 1
Time Online: 1 Day, 6:13:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

eh infatti poi ci sono arrivato anche se stat sbarellava con ls. devo provare con find...

03-07-2010 13:15
Click Here to See the Profile for Chobeat Click here to Send Chobeat a Private Message Find more posts by Chobeat Add Chobeat to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Semmy13
.novellino.

User info:
Registered: Nov 2008
Posts: 3 (0.00 al dì)
Location:
Corso: Informatica
Anno: Primo
Time Online: 2:13:59 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Salvo errori di sintassi dovrebbe essere:


find / -type f | while read file; do
if $(stat -Mtime $file|grep -s -i "fri"); then
echo $file
fi
done


In pratica con la prima riga leggi tutti i file.
Con la seconda verifichi se la data "matcha" fri (venerdì). grep -s torna un booleano (-i serve per dirgli di ignorare maiuscole e minuscole)
Poi semplicemente stampi i file che soddisfano la condizione

03-07-2010 16:18
Click Here to See the Profile for Semmy13 Click here to Send Semmy13 a Private Message Find more posts by Semmy13 Add Semmy13 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Chobeat
.illuminato.

User info:
Registered: Sep 2007
Posts: 241 (0.04 al dì)
Location: Alessandria
Corso: Informatica
Anno: 1
Time Online: 1 Day, 6:13:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

mmm io ho fatto diversamente alla fine.

ho fatto il file=$(find...), poi ci ho dovuto fare un for i in $file perchè sennò stat mi prendeva schifezze. l'if poi non l'ho messo, ho semplicemente fatto un grep sul risultato e stampato...

04-07-2010 09:54
Click Here to See the Profile for Chobeat Click here to Send Chobeat a Private Message Find more posts by Chobeat Add Chobeat to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 19:34.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.072 seconds (51.17% PHP - 48.83% MySQL) con 26 query.