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 > Esame di laboratorio (Giugno 2007) - Domande Thread Rating: 3 votes, 5.00 average.
Pages (571): « First ... « 560 561 562 563 [564] 565 566 567 568 » ... Last »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
mauro21
.primate.

User info:
Registered: Mar 2009
Posts: 73 (0.01 al dì)
Location: Buccinasco
Corso: Informatica
Anno: Laureato
Time Online: 3 Days, 14:23:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by basslele
Anche io posto l'esercizio che mi ha fatto fare.

Trovare il numero dei file che contengono la parola "copyright" e hanno il nome composto da un numero pari di caratteri

io ho fatto così:

#! /bin/sh

sum=0;
for file in $(find / -type f | xargs grep -l "copyright" | rev | cut -d / -f 1 | rev); do
numero=$(echo "$file" | wc -c )
if (expr $(expr $numero % 2) -eq 0); then
sum=expr($sum + 1)
fi
done
echo "numero file: $sum"


provandolo a fare mi viene una cosa molto simile (praticamente =), solo che prima di stampare l'ultima stringa con il risultato, mi stampa molte linee con scritto grep: line too long - truncated

io qui metto 2>/dev/null dopo la grep x "ovviare" al problema

come viene visto in sede d'esame???

questo errore mi esce anche con altri esercizi.

05-09-2011 17:39
Click Here to See the Profile for mauro21 Click here to Send mauro21 a Private Message Visit mauro21's homepage! Find more posts by mauro21 Add mauro21 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 00:05.    Post New Thread    Post A Reply
Pages (571): « First ... « 560 561 562 563 [564] 565 566 567 568 » ... Last »   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.044 seconds (63.22% PHP - 36.78% MySQL) con 24 query.