11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

# Cancella i CR e scrive il file nuovo.<br />

Capitolo 12. Filtri, programmi e coman<strong>di</strong> esterni<br />

echo "Il file <strong>di</strong> testo originale DOS è \"$1\"."<br />

echo "Il file <strong>di</strong> testo tradotto in formato UNIX è \"$NOMENUOVOFILE\"."<br />

exit 0<br />

# Esercizio:<br />

#-----------<br />

# Mo<strong>di</strong>ficate lo script per la conversione inversa (da UNIX a DOS).<br />

Esempio 12-21. rot13: cifratura ultra-debole<br />

#!/bin/bash<br />

# rot13.sh: Classico algoritmo rot13, cifratura che potrebbe beffare solo un<br />

# bambino <strong>di</strong> 3 anni.<br />

# Utilizzo: ./rot13.sh nomefile<br />

# o ./rot13.sh

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!