<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>BASH Programming - Introduction HOWTO</TITLE> <LINK HREF="Bash-Prog-Intro-HOWTO-1.html" REL=next> </HEAD> <BODY> <A HREF="Bash-Prog-Intro-HOWTO-1.html">Avanti</A> Indietro Indice <HR> <H1>BASH Programming - Introduction HOWTO</H1> <H2>di Mike G <CODE>mikkey@dynamo.com.ar</CODE></H2>Lunedì 17 Luglio 11:47:00 ART 2000 <P><HR> <EM> Questo articolo si propone di aiutarti ad iniziare a programmare script di shell di livello base-intermedio. Non vuole essere un documento avanzato (vedi il titolo). Io NON sono un esperto o un guru della programmazione della shell. Ho deciso di scrivere questo HOWTO perché imparerò molto e potrebbe essere utile ad altre persone. Qualsiasi tipo di riscontro sarà apprezzato, specialmente se in forma di patch :) . Traduzione di <A HREF="mailto:wizzy@tiscalinet.it">William Ghelfi</A> a.k.a. Wiz of Id, Mercoledì 19 Luglio 2000. </EM> <HR> <P> <H2><A NAME="toc1">1.</A> <A HREF="Bash-Prog-Intro-HOWTO-1.html">Introduzione</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-1.html#ss1.1">1.1 Ottenere l'ultima versione</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-1.html#ss1.2">1.2 Requisiti</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-1.html#ss1.3">1.3 Usi di questo documento</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-1.html#ss1.4">1.4 Traduzioni</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-1.html#ss1.5">1.5 Note sulla traduzione</A> </UL> <P> <H2><A NAME="toc2">2.</A> <A HREF="Bash-Prog-Intro-HOWTO-2.html">Script molto facili</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-2.html#ss2.1">2.1 Il tradizionale script hello world</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-2.html#ss2.2">2.2 Uno script di backup molto semplice</A> </UL> <P> <H2><A NAME="toc3">3.</A> <A HREF="Bash-Prog-Intro-HOWTO-3.html">Tutto sulla redirezione</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-3.html#ss3.1">3.1 Teoria e riferimento veloce</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-3.html#ss3.2">3.2 Esempio: stdout verso file </A> <LI><A HREF="Bash-Prog-Intro-HOWTO-3.html#ss3.3">3.3 Esempio: stderr verso file </A> <LI><A HREF="Bash-Prog-Intro-HOWTO-3.html#ss3.4">3.4 Esempio: stdout verso stderr</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-3.html#ss3.5">3.5 Esempio: stderr verso stdout </A> <LI><A HREF="Bash-Prog-Intro-HOWTO-3.html#ss3.6">3.6 Esempio: stderr e stdout verso file </A> </UL> <P> <H2><A NAME="toc4">4.</A> <A HREF="Bash-Prog-Intro-HOWTO-4.html">Le pipe </A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-4.html#ss4.1">4.1 Che cosa sono e perché vorrai utilizzarle</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-4.html#ss4.2">4.2 Esempio: semplice pipe con sed </A> <LI><A HREF="Bash-Prog-Intro-HOWTO-4.html#ss4.3">4.3 Esempio: una alternativa a ls -l *.txt </A> </UL> <P> <H2><A NAME="toc5">5.</A> <A HREF="Bash-Prog-Intro-HOWTO-5.html">Variabili</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-5.html#ss5.1">5.1 Esempio: Hello World! usando le variabili</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-5.html#ss5.2">5.2 Esempio: Uno script di backup molto semplice (un poco migliore)</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-5.html#ss5.3">5.3 Variabili locali</A> </UL> <P> <H2><A NAME="toc6">6.</A> <A HREF="Bash-Prog-Intro-HOWTO-6.html">Condizionali</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-6.html#ss6.1">6.1 Pura Teoria</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-6.html#ss6.2">6.2 Esempio: Esempio basilare di condizionale if .. then</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-6.html#ss6.3">6.3 Esempio: Esempio basilare di condizionale if .. then ... else</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-6.html#ss6.4">6.4 Esempio: Condizionali con variabili</A> </UL> <P> <H2><A NAME="toc7">7.</A> <A HREF="Bash-Prog-Intro-HOWTO-7.html">Cicli for, while e until</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-7.html#ss7.1">7.1 Per esempio</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-7.html#ss7.2">7.2 For simil-C</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-7.html#ss7.3">7.3 Esempio di while</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-7.html#ss7.4">7.4 Esempio di until</A> </UL> <P> <H2><A NAME="toc8">8.</A> <A HREF="Bash-Prog-Intro-HOWTO-8.html">Funzioni</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-8.html#ss8.1">8.1 Esempio di funzioni</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-8.html#ss8.2">8.2 Esempio di funzioni con parametri</A> </UL> <P> <H2><A NAME="toc9">9.</A> <A HREF="Bash-Prog-Intro-HOWTO-9.html">Interfacce utente</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-9.html#ss9.1">9.1 Utilizzo di select per la creazione di semplici menù</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-9.html#ss9.2">9.2 Usare la riga di comando</A> </UL> <P> <H2><A NAME="toc10">10.</A> <A HREF="Bash-Prog-Intro-HOWTO-10.html">Varie</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-10.html#ss10.1">10.1 Leggere l'input dell'utente con read</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-10.html#ss10.2">10.2 Valutazione aritmetica</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-10.html#ss10.3">10.3 Trovare bash </A> <LI><A HREF="Bash-Prog-Intro-HOWTO-10.html#ss10.4">10.4 Prendere il valore di ritorno da un programma</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-10.html#ss10.5">10.5 Catturare l'output di un programma </A> <LI><A HREF="Bash-Prog-Intro-HOWTO-10.html#ss10.6">10.6 File a sorgenti multipli</A> </UL> <P> <H2><A NAME="toc11">11.</A> <A HREF="Bash-Prog-Intro-HOWTO-11.html">Tavole</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-11.html#ss11.1">11.1 Operatori di confronto tra stringhe</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-11.html#ss11.2">11.2 Esempi di confronto tra stringhe</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-11.html#ss11.3">11.3 Operatori aritmetici</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-11.html#ss11.4">11.4 Operatori aritmetici relazionali</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-11.html#ss11.5">11.5 Comandi utili</A> </UL> <P> <H2><A NAME="toc12">12.</A> <A HREF="Bash-Prog-Intro-HOWTO-12.html">Altri Script</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-12.html#ss12.1">12.1 Applicare un comando a tutti i file in una directory. </A> <LI><A HREF="Bash-Prog-Intro-HOWTO-12.html#ss12.2">12.2 Esempio: Uno script di backup molto semplice (ancora un poco migliore)</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-12.html#ss12.3">12.3 Rinominatore di file</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-12.html#ss12.4">12.4 Rinominatore di file (semplice)</A> </UL> <P> <H2><A NAME="toc13">13.</A> <A HREF="Bash-Prog-Intro-HOWTO-13.html">Quando qualcosa va male (debugging)</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-13.html#ss13.1">13.1 Modi di chiamare BASH </A> </UL> <P> <H2><A NAME="toc14">14.</A> <A HREF="Bash-Prog-Intro-HOWTO-14.html">Informazioni sul documento</A></H2> <UL> <LI><A HREF="Bash-Prog-Intro-HOWTO-14.html#ss14.1">14.1 (no) warranty</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-14.html#ss14.2">14.2 Traduzioni</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-14.html#ss14.3">14.3 Grazie a</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-14.html#ss14.4">14.4 History</A> <LI><A HREF="Bash-Prog-Intro-HOWTO-14.html#ss14.5">14.5 Altre risorse</A> </UL> <HR> <A HREF="Bash-Prog-Intro-HOWTO-1.html">Avanti</A> Indietro Indice </BODY> </HTML>