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 14:57 (6 anni fa)] – 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 {{informatica: | ||
| + | [nomedelfile senza estensione] | ||
| + | test1 | ||
| + | test2 | ||
| + | NOTA: per effettuare i calcoli in floating point usare il comando '' | ||
informatica/sol/laboratorio20/esercitazionib/esercitazione6.1584802675.txt.gz · Ultima modifica: 21/03/2020 alle 14:57 (6 anni fa) da Massimo Torquati
