Updated user guide.
* Added Maciej Baluta's GCI work on NetworkStatus, PowerStatus and ProcessController with only minor changes. * Created a page for Daniel Marth's GCI work, based on the wiki page at https://dev.haiku-os.org/wiki/SystemBinCommands * Updated translations mostly for Japanese and Italian from the currently running GCI tasks. Thanks everyone! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39724 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -9,12 +9,14 @@
|
||||
*
|
||||
* Authors:
|
||||
* Humdinger <[email protected]>
|
||||
* Translators:
|
||||
* Barret
|
||||
*
|
||||
-->
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||
<meta name="robots" content="all" />
|
||||
<title>Bash and Scripting</title>
|
||||
<title>La Bash e lo "Scripting"</title>
|
||||
<link rel="stylesheet" type="text/css" href="../Haiku-doc.css" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -41,57 +43,55 @@
|
||||
<span>
|
||||
« <a href="preferences.html">Preferenze</a>
|
||||
:: <a href="contents.html" class="uplink">Contenuti</a>
|
||||
<!-- :: <a href="filesystem-layout.html">Filesystem Layout
|
||||
</a> » -->
|
||||
<!-- :: <a href="filesystem-layout.html">La struttura del FileSystem di Haiku</a> » -->
|
||||
</span></div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div>
|
||||
<div class="box-info">La traduzione di questa pagina non è stata completata. Per questo motivo le parti non tradotte sono visibili in inglese.</div>
|
||||
|
||||
<h1>Bash and Scripting</h1>
|
||||
<h1>La Bash e lo "Scripting"</h1>
|
||||
|
||||
<p>"Scripting" is the technique of automating procedures by stringing together commands and saving it all as text files, so called "scripts". Every time you run such a script, the commands are processed one after the other just like they would if you entered them into the <a href="applications/terminal.html">Terminal</a> by hand.<br />
|
||||
Scripts can range from simply executing a few commands in a specific order to sophisticated pieces of code that solve complex tasks.</p>
|
||||
<p>Lo "scripting" è una tecnica che permette l'esecuzione automatica di procedure concatenando i comandi e salvandoli in un file di testo, i cosiddetti "script". Ogni volta che esegui uno script, i comandi vengono eseguiti uno dopo l'altro, esattamente come succederebbe se li digitassi a mano direttamente nel <a href="applications/terminal.html">Terminale</a> <br />
|
||||
Gli script possono variare dalla semplice esecuzione di alcuni comandi in uno specifico ordine fino a pezzi di codice sofisticati in grado di risolvere compiti complessi.</p>
|
||||
|
||||
<h2>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
<a id="bash" name="bash">The Bash</a></h2>
|
||||
<p>Since scripts rely naturally a lot on the shell they are interpreted by, you should first familiarize yourself with the BASH that's used by Haiku. There are many resources online as it's a widely used shell. One nice document is Johan Jansson's <a href="http://www.beforever.com/bashtut.htm" class="printurl">Introduction to bash - a tutorial for bash under BeOS</a>.</p>
|
||||
<a id="bash" name="bash">La Bash</a></h2>
|
||||
<p>Dal momento che gli script si basano ovviamente sulla shell che li interpreta, bisogna prima familiarizzare con la BASH, la shell usata da Haiku. Ci sono molte risorse online dal momento che è una delle shell più usate. Un buon documento è <a href="http://www.beforever.com/bashtut.htm" class="printurl">Introduction to bash - a tutorial for bash under BeOS</a> di Johan Jansson (in lingua inglese).</p>
|
||||
|
||||
<h2>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
<a id="scripting-bible" name="scripting-bible">The Scripting Bible</a></h2>
|
||||
<p>After you've learned a few basics about working in the shell, it's time to slowly ease yourself into the world of scripting. Again, you'll find loads of tutorials and reference material online as well as in bookstores. A very nice introduction that's practically tailor-made for Haiku is the online available <a href="http://www.birdhouse.org/beos/bible/bos/ch_scripting1.html" class="printurl">Scripting Chapter</a> (<a href="http://www.birdhouse.org/beos/bible/bos/BeOS.scripting.PDF">PDF, 900kb</a>) of Scot Hacker's BeOS Bible.</p>
|
||||
<a id="scripting-bible" name="scripting-bible">La Bibbia dello Scripting</a></h2>
|
||||
<p>Dopo aver appreso alcune nozioni di base su come lavorare nella shell, è tempo di entrare lentamente nel mondo dello scripting. Ancora una volta, puoi trovare un sacco di tutorial e di materiale on-line di riferimento. Un'introdzione molto buona che praticamente è scritta su misura per Haiku, disponibile on-line è <a href="http://www.birdhouse.org/beos/bible/bos/ch_scripting1.html" class="printurl">Scripting Chapter</a> (<a href="http://www.birdhouse.org/beos/bible/bos/BeOS.scripting.PDF">PDF, 900kb</a>) dalla bibbia di BeOS di Scot Hacker (in lingua inglese).</p>
|
||||
|
||||
<h2>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a><a id="user-scripts" name="user-scripts">Scripts in Haiku</a></h2>
|
||||
<p>In Haiku, the system makes of course also use of scripting. Booting and shutting down are typical scripting procedures. These defined sequences can be augmented by the user with certain user scripts.<br />
|
||||
If they don't exist already, you'll have to create the needed files yourself. Otherwise simply add your commands where in the process you want them to be executed.</p>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a><a id="user-scripts" name="user-scripts">Gli script in Haiku</a></h2>
|
||||
<p>In Haiku, anche il sistema fa uso dello scripting, l'avvio e lo spegnimento ne sono tipiche procedure. Queste sequenze possono essere estese dall'utente per mezzo di alcuni script. <br />
|
||||
Se non esistono già, dovrai creare i file necessari, altrimenti ti basterà aggiungere i comandi nella parte del file corrispondente al punto del processo nel quale vuoi che vengano eseguiti.</p>
|
||||
|
||||
<h3>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
<a id="userbootscript" name="userbootscript">The UserBootscript</a></h3>
|
||||
<p><span class="path">/boot/home/config/boot/UserBootscript</span> will be executed after the system has finished its boot process. For example, you could launch a number of programs that would then be automatically started on every boot up:</p>
|
||||
<a id="userbootscript" name="userbootscript">L'UserBootscript</a></h3>
|
||||
<p><span class="path">/boot/home/config/boot/UserBootscript</span> verrà eseguito dopo che il sistema ha finito il suo processo di avvio. Per esempio, potresti lanciare un certo numero di programmi da essere eseguiti in automatico ad ogni avvio in questo modo:</p>
|
||||
<pre># Start LaunchBox
|
||||
/boot/system/apps/LaunchBox &
|
||||
|
||||
# Start Workspaces Applet
|
||||
/boot/system/apps/Workspaces &</pre>
|
||||
<p>Remember to end a command with an "<tt>&</tt>" to start it as a background process, or the script will halt until that command has finished (in this case: the launched app was closed again).</p>
|
||||
<p>Ricordati però di terminare ogni comando con un "<tt>&</tt>" per avviare il processo in background, altrimenti lo script si interromperà soltanto quando il comando avrà terminato la sua esecuzione (in questo caso, quando viene chiusa l'applicazione).</p>
|
||||
|
||||
<p>A simple alternative to the above for launching applications at boot up is to put links to them in the <span class="path">/boot/home/config/boot/launch</span> directory. This can be done simply by right-clicking on the application you wish to have started automatically, going to <span class="menu">Create Link</span> and then <a href="tracker.html#navigating">navigating</a> to the above directory.</p>
|
||||
<p>Una semplice alternativa a quella presentata di sopra per lanciare applicazioni all'avvio, consiste nel creare dei collegamenti a queste nella cartella <span class="path">/boot/home/config/boot/launch</span>. Questo può essere fatto semplicemente cliccando col tasto destro nell'applicazione che si desidera avviare automaticamente, andando su <span class="menu">Crea Link</span> e poi <a href="tracker.html#navigating">navigando</a> fino alla cartella precedentemente citata.</p>
|
||||
|
||||
<h3>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
<a id="usershutdownscript" name="usershutdownscript">The UserShutdownScript</a></h3>
|
||||
<p><span class="path">/boot/home/config/boot/UserShutdownScript</span> will be executed as the first step in the shutdown process. If the script returns a non-zero exit status, the shutdown is aborted.</p>
|
||||
<a id="usershutdownscript" name="usershutdownscript">L'UserShutdownScript</a></h3>
|
||||
<p><span class="path">/boot/home/config/boot/UserShutdownScript</span> verrà eseguito come primo passo nel processo di spegnimento. Se lo script ritorna uno stato diverso da 0, lo spegnimento viene arrestato.</p>
|
||||
|
||||
<h3>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
<a id="usershutdownfinishscript" name="usershutdownfinishscript">The UserShutdownFinishScript</a></h3>
|
||||
<p><span class="path">/boot/home/config/boot/UserShutdownFinishScript</span> is executed as the last step in the shutdown process. Note, that most parts of the system have terminated by the time this script is executed.</p>
|
||||
<a id="usershutdownfinishscript" name="usershutdownfinishscript">L'UserShutdownFinishScript</a></h3>
|
||||
<p><span class="path">/boot/home/config/boot/UserShutdownFinishScript</span> verrà eseguito come ultimo passo nel processo di spegnimento. Nota che la maggior parte del sistema sarà già stato terminato da tempo quando questo script verrà eseguito.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,8 +100,7 @@ If they don't exist already, you'll have to create the needed files yourself. Ot
|
||||
<div class="inner"><span>
|
||||
« <a href="preferences.html">Preferenze</a>
|
||||
:: <a href="contents.html" class="uplink">Contenuti</a>
|
||||
<!-- :: <a href="filesystem-layout.html">Filesystem Layout
|
||||
</a> » -->
|
||||
<!-- :: <a href="filesystem-layout.html">La struttura del FileSystem di Haiku</a> » -->
|
||||
</span></div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user