informatica:sol:laboratorio20:esercitazionib:esercitazione6
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| informatica:sol:laboratorio20:esercitazionib:esercitazione6 [21/03/2020 alle 17:11 (6 anni fa)] – [Esercizio 4] Massimo Torquati | informatica:sol:laboratorio20:esercitazionib:esercitazione6 [24/03/2020 alle 09:06 (6 anni fa)] (versione attuale) – Massimo Torquati | ||
|---|---|---|---|
| Linea 21: | Linea 21: | ||
| bdir=$(basename $dir) | bdir=$(basename $dir) | ||
| if [ -w ....... ]; then # il file esiste ed e scrivibile | if [ -w ....... ]; then # il file esiste ed e scrivibile | ||
| - | echo "il file $bdir.tar.gz esiste gia sovrascriverlo (S/ | + | echo -n "il file $bdir.tar.gz esiste gia', |
| read yn # (commenta il codice) ......... | read yn # (commenta il codice) ......... | ||
| - | if [ "$yn" | + | if [ x$yn != x" |
| exit 0; | exit 0; | ||
| fi | fi | ||
| Linea 30: | Linea 30: | ||
| echo "creo l' | echo "creo l' | ||
| - | tar cf $bdir.tar $dir ............... | + | tar cf $bdir.tar $dir ............... |
| - | if [ ...... ]; then # | + | if [ ...... ]; then # |
| echo " | echo " | ||
| exit 1 | exit 1 | ||
| fi | fi | ||
| - | gzip $bdir.tar | + | gzip $bdir.tar |
| - | if [ ...... ]; then # | + | if [ ...... ]; then # |
| echo | echo | ||
| echo " | echo " | ||
| Linea 49: | Linea 49: | ||
| ===== Esercizio 2 ===== | ===== Esercizio 2 ===== | ||
| - | Scrivere uno script bash che prende " | + | Scrivere uno script bash che prende " |
| + | SUGGERIMENTO: | ||
| ===== Esercizio 3 ===== | ===== Esercizio 3 ===== | ||
| Linea 63: | Linea 64: | ||
| ===== Esercizio 4 ===== | ===== Esercizio 4 ===== | ||
| - | Dati i file testuali contenuti in questo tarball, ognuno dei quali contiene per ogni riga due campi separati da spazio ('id valore' | + | Dati i file testuali contenuti in {{informatica: |
| [nomedelfile senza estensione] | [nomedelfile senza estensione] | ||
| test1 | test1 | ||
| test2 | test2 | ||
| - | NOTA: per effettuare i calcoli in floating point usare il comando '' | + | NOTA: per effettuare i calcoli in floating point usare il comando '' |
informatica/sol/laboratorio20/esercitazionib/esercitazione6.1584810684.txt.gz · Ultima modifica: 21/03/2020 alle 17:11 (6 anni fa) da Massimo Torquati
