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 ... « 43 44 45 46 [47] 48 49 50 51 » ... Last »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
n3o
tanto c'è SPASS...

User info:
Registered: Oct 2005
Posts: 134 (0.02 al dì)
Location: Brescia
Corso: Informatica Magistrale
Anno:
Time Online: 1 Day, 19:26:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

xargs è un comando utile per evitare l'errore Out of space che a volte compare se si utilizza il find.
La shell ha un limitato spazio per gestire un comando (credo 256 caratteri...) quindi se un input di un comando (rediretto anche con un pipe) supera tale limite sorge l'errore di cui sopra.
Per evitarlo si utilizza xargs che non fa altro che spezzare l'output del comando precedente in righe, e passare ogni riga al comando successivo, una alla volta.
Più importante, xargs cambia profondamente il comportamento dei comandi:

find / -type f | grep login

Questo comando cerca tra la lista dei file del sistema, un file il cui nome contenga la parola login

find / -type f | xargs grep login

In questo esempio xargs spezza la listona dei file del sistema e passa una riga per volta (quindi un nome di file per volta) a grep
(grep viene eseguito più volte, una volta per ogni riga).
Notate che il comportamento cambia moltissimo!!!
In questo caso il comando stampa tutti i file di sistema che contengono al loro interno la parola login

Nella maggior parte degli esempi sort e tail vengono usati sulle liste di file che genera find o in passi successivi, per questo non viene utilizzato xargs.

__________________
The answer is blowing in the wind...

12-07-2007 10:49
Click Here to See the Profile for n3o Click here to Send n3o a Private Message Find more posts by n3o Add n3o to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 12:38.    Post New Thread    Post A Reply
Pages (571): « First ... « 43 44 45 46 [47] 48 49 50 51 » ... 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.051 seconds (60.08% PHP - 39.92% MySQL) con 24 query.