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 (39): « First ... « 6 7 8 9 [10] 11 12 13 14 » ... Last »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Peach
.amico.

User info:
Registered: Jun 2007
Posts: 22 (0.00 al dì)
Location: Milano
Corso: Informatica triennale
Anno: 1^ fuori corso
Time Online: 7:13:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Scusate ma come si fa a rendere eseguibile uno script?

19-07-2007 17:54
Click Here to See the Profile for Peach Click here to Send Peach a Private Message Find more posts by Peach Add Peach to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Peach
.amico.

User info:
Registered: Jun 2007
Posts: 22 (0.00 al dì)
Location: Milano
Corso: Informatica triennale
Anno: 1^ fuori corso
Time Online: 7:13:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Simaldeff
mmmmhhh io il gzip non c'e' l'ho sul mio minix ... quello dell'imagine che c'e' sul wiki.


idema ma suppongo che si usi come il camando tar no?

19-07-2007 18:08
Click Here to See the Profile for Peach Click here to Send Peach a Private Message Find more posts by Peach Add Peach to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Laüra
.simpatizzante.

User info:
Registered: Dec 2004
Posts: 14 (0.00 al dì)
Location:
Corso: Informatica
Anno: 3
Time Online: 13:03:02: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Peach
Scusate ma come si fa a rendere eseguibile uno script?


Come prima riga devi scrivere:

#!/bin/sh

E devi mettere il permesso x al file con chmod.

19-07-2007 18:44
Click Here to See the Profile for Laüra Click here to Send Laüra a Private Message Find more posts by Laüra Add Laüra to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Peach
.amico.

User info:
Registered: Jun 2007
Posts: 22 (0.00 al dì)
Location: Milano
Corso: Informatica triennale
Anno: 1^ fuori corso
Time Online: 7:13:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ok grazie mille

19-07-2007 18:45
Click Here to See the Profile for Peach Click here to Send Peach a Private Message Find more posts by Peach Add Peach to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darkman13
.arcimaestro.

User info:
Registered: Feb 2004
Posts: 272 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 3 Days, 14:00:17 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Approfitto per l'ennesima volta del gentilezza di n3o... Trovare il processo con pid dispari che occupa più spazio in memoria?

19-07-2007 19:07
Click Here to See the Profile for darkman13 Click here to Send darkman13 a Private Message Find more posts by darkman13 Add darkman13 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
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

Ma dove li trovi questi orrori ???

code:
#!/bin/sh MAXSIZE=0 MAXPID=0 for PROC in $(ps alx | tr -s ' ' : | cut -d : -f 5,8); do PID=$(echo $PROC | cut -d : -f 1) SIZE=$(echo $PROC | cut -d : -f 2) if [ $PID % 2 -eq 1 -a $SIZE -gt $MAXSIZE ]; then MAXPID=$PID MAXSIZE=$SIZE fi done echo "Processo con PID dispari più esoso: $MAXPID con $MAXSIZE KB"

Spiegazione:
  • Dalla lista di tutti i processi comprimo tutti gli spazi contigui nel carattere ':' che userò come separatore di colonne (lo spazio faceva danno); estraggo le colonne 5 e 8 che sono PID e SIZE (anche qui trovate osservando il comportamento dei comandi)
    Le righe ora sono della forma PID:SIZE (12:552)
  • Estraggo i PID come prima colonna dalla variabile PROC
  • Estraggo i SIZE come seconda colonna dalla variabile PROC
  • Se il PID % 2 è uguale a 1 (dispari) e SIZE è maggiore di MAXSIZE
  • Aggiorno il PID e il SIZE massimi

__________________
The answer is blowing in the wind...

Last edited by n3o on 19-07-2007 at 20:35

19-07-2007 20:19
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
Collapse
darkman13
.arcimaestro.

User info:
Registered: Feb 2004
Posts: 272 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 3 Days, 14:00:17 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

sono stai chiesti a ragazzi nel esame... non capisco il dislivello allucinante tra gli esercizi

19-07-2007 20:48
Click Here to See the Profile for darkman13 Click here to Send darkman13 a Private Message Find more posts by darkman13 Add darkman13 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
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

E con questo, signori, auguro buona fortuna a tutti (in bocca al lupo per quelli superstiziosi) specialmente a quelli del turno di domani. :approved:

Vado a godermi (meritate) vacanze! :ciaoo: (e buone vacanze anche a voi!) :D
See you soon on DSY :muhehe:

PS: dimenticavo, oggi è l'anniversario dell'attentato a Paolo Borsellino...
Persone come lui, il cielo solo raramente ce le manda.
Grazie. :angel:

__________________
The answer is blowing in the wind...

Last edited by n3o on 19-07-2007 at 23:10

19-07-2007 21:08
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
Collapse
plafo
.illuminato.

User info:
Registered: Nov 2004
Posts: 236 (0.03 al dì)
Location: Milano
Corso: informatica
Anno: terzo
Time Online: 4 Days, 20:03:23 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by darkman13
sono stai chiesti a ragazzi nel esame... non capisco il dislivello allucinante tra gli esercizi





sai qualche altro tipo di esercizio che è stato chiesto questa volta?

20-07-2007 00:00
Click Here to See the Profile for plafo Click here to Send plafo a Private Message Find more posts by plafo Add plafo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darkman13
.arcimaestro.

User info:
Registered: Feb 2004
Posts: 272 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 3 Days, 14:00:17 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

no solo questo!

20-07-2007 00:07
Click Here to See the Profile for darkman13 Click here to Send darkman13 a Private Message Find more posts by darkman13 Add darkman13 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
GiKappa
Dubbioso a Progetto

User info:
Registered: Oct 2004
Posts: 1800 (0.23 al dì)
Location: Brescia
Corso: Informatica
Anno: Laureato Triennale
Time Online: 9 Days, 22:40:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

a me aveva chiesto di scrivere uno script per trovare per ogni utente l'occupazione in memoria (mi sembra che sia stato già scritto)

20-07-2007 08:39
Click Here to See the Profile for GiKappa Click here to Send GiKappa a Private Message Find more posts by GiKappa Add GiKappa to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Vid
.interista.

User info:
Registered: Jan 2004
Posts: 8 (0.00 al dì)
Location: Milano
Corso: Informatica
Anno: n(lg n)
Time Online: 8:56:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

E anche sistemi operativi l'abbiamo archiviato :)

Vi posto gli esercizi che mi hanno assegnato:

# SHELL SCRIPT #

Creare uno script che produca in uscita una lista ordinata del numero totale dei files presenti nel filesystem per ogni utente.

# KERNEL #

Creare una syscall che, opportunamente richiamata tramite un programma, stampi il numero di volte che è stata chiamata a partire dal boot.

Un altro esercizio di script che ho sentito assegnare riguardava il produrre un elenco dei file al cui interno fosse contenuta la parola "copyright" case-insensitive.

In bocca al lupo a chi ancora deve darlo e buone ferie e vacanze a chi lo ha dato.

20-07-2007 09:03
Click Here to See the Profile for Vid Click here to Send Vid a Private Message Find more posts by Vid Add Vid to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Paul03
.arcimaestro.

User info:
Registered: Feb 2005
Posts: 290 (0.04 al dì)
Location: Oleggio
Corso: Informatica
Anno: 3
Time Online: 1 Day, 19:39:12 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ragazzi vi posto l'esercizio che è stato chiesto a me che contiene l'AR... La consegna era:
Creare un archivio gzip (tar.gz) che contenga tutti i file che inziano per "c" e la cui dimensione sia inferiore di 10 kb:

find / -type f -name c\* -size -20 | ar ** nomearchivio

Spiegazione:
-type f: cerca tutti i file
-name c\*: tutti i file che iniziano per c (attenzione ad utilizzare \* e non solo * in quanto usando solo * se la prima lettera del primo file dopo la c fosse a cercherebbe tutti i file che iniziano per ca)
-size -20:tutti i file <10kb (20 sono i blocchi)
ar **: dove ** sono gli attributi che giuro non ricordo comunque ci sono sul man

Ciauzzz

20-07-2007 10:56
Click Here to See the Profile for Paul03 Click here to Send Paul03 a Private Message Find more posts by Paul03 Add Paul03 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
matteojacoca
.novellino.

User info:
Registered: Dec 2006
Posts: 2 (0.00 al dì)
Location:
Corso:
Anno:
Time Online: 4:42:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ciao Raga,
a me hanno chiesto:

1)Calcolare per ogni utente lo spazio occupato sul sitema
2)Come esercizio di Kernel: Visualizzare quante volte viene terminato un processo.

1)Per il primo..ci sono rimasto male...in quanto...io come molti ci eravamo studiati tutti gli esercizi proposti qui e sul wiki...peccato che (non so che cacchio hanno combinato Trentini e Monga) sta di fatto che molti degli esercizi proposti ieri a casa andavano benissimo e chi sà come mai all'esame non funzionavano....

Vi faccio vedere la mia soluzione del Primo:

#!/bin/sh
for i in $(cut /etc/passwd -d : -f 3 | sort -n | uniq); do
SUM=0
for file in $(find / -type f -user $i | xargs du | cut -f 1); do
SUM=$(expr $SUM + $file)
done
echo "L'utente $i occupa $SUM KB sul sistema"
done

A casa perfetta, all'esame restituiva..."Out of Space".....bene....
Allora mi sono dovuto inventare una soluzione assurda....mettendo prima le dimensioni in un file...poi attraverso un while...cercare di sommarle....(che poi ovviamente non mi è venuto)....morale sono riuscito a portami a casa un SUDATISSIMO...21....e non sò ancora come ho fatto...
Conclusione:
State attenti, perchè molte delle soluzioni proposte sia qui che sul wiki, potrebbero NON funzionare...anche se sono PERFETTAMENTE CORRETTE....ho visto un sacco di gente bocciata per questo!!!!

Ciao

20-07-2007 11:28
Click Here to See the Profile for matteojacoca Click here to Send matteojacoca a Private Message Visit matteojacoca's homepage! Find more posts by matteojacoca Add matteojacoca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
=kimi=
.primate.

User info:
Registered: Jan 2006
Posts: 69 (0.01 al dì)
Location: milano
Corso: Informatica
Anno: 1
Time Online: 3:26:04: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ciao raga
anche io ho fatto l'esame oggi, posso dirvi che l'esercizio dishell fa a fortuna! a me ha chiesto proprio quello di paul03 ( con l'aggiunta che dovevano anche essere file eseguibili ).
per il kernel dovevo modificare il file do_exit.c per farsi che ogni volta un processo usciva, dovevo incrementare un contatore e visualizzare ad ogni uscita il suo valore.

cmq si a fortuna...

in bocca al lupo...

20-07-2007 12:48
Click Here to See the Profile for =kimi= Click here to Send =kimi= a Private Message Find more posts by =kimi= Add =kimi= to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 14:13.    Post New Thread    Post A Reply
Pages (39): « First ... « 6 7 8 9 [10] 11 12 13 14 » ... 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.138 seconds (34.85% PHP - 65.15% MySQL) con 23 query.