<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.ainw.org/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Mon wiki - informatique:bash</title>
        <description></description>
        <link>https://www.ainw.org/wiki/</link>
        <lastBuildDate>Fri, 08 May 2026 06:41:46 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://www.ainw.org/wiki/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>Mon wiki</title>
            <link>https://www.ainw.org/wiki/</link>
        </image>
        <item>
            <title>bonnes_pratiques</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:bonnes_pratiques&amp;rev=1732573381&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;bonnes_pratiques&quot;&gt;Bonnes pratiques&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Liste de pages recensant les bonnes pratiques à appliquer lors de l&amp;#039;écriture de scripts :
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://redsymbol.net/articles/unofficial-bash-strict-mode/&quot; class=&quot;urlextern&quot; title=&quot;http://redsymbol.net/articles/unofficial-bash-strict-mode/&quot; rel=&quot;ugc nofollow&quot;&gt;Bash Strict Mode&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://blog.seboss666.info/2020/04/programmation-defensive-en-bash/&quot; class=&quot;urlextern&quot; title=&quot;https://blog.seboss666.info/2020/04/programmation-defensive-en-bash/&quot; rel=&quot;ugc nofollow&quot;&gt;Programmation défensive en bash – Le blog de Seboss666&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://shaarli.guiguishow.info/?gKD9Ow&quot; class=&quot;urlextern&quot; title=&quot;http://shaarli.guiguishow.info/?gKD9Ow&quot; rel=&quot;ugc nofollow&quot;&gt;Quand le gruik découvre set -e et trap ERR - GuiGui&amp;#039;s Show&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://ashishb.net/all/the-first-two-statements-of-your-bash-script-should-be/&quot; class=&quot;urlextern&quot; title=&quot;https://ashishb.net/all/the-first-two-statements-of-your-bash-script-should-be/&quot; rel=&quot;ugc nofollow&quot;&gt;The first two statements of your BASH script should be…&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://mywiki.wooledge.org/BashPitfalls&quot; class=&quot;urlextern&quot; title=&quot;https://mywiki.wooledge.org/BashPitfalls&quot; rel=&quot;ugc nofollow&quot;&gt;BashPitfalls - Greg&amp;#039;s Wiki&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425&quot; class=&quot;urlextern&quot; title=&quot;https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425&quot; rel=&quot;ugc nofollow&quot;&gt;set -e, -u, -o, -x pipefail explanation · GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://mywiki.wooledge.org/BashFAQ/035&quot; class=&quot;urlextern&quot; title=&quot;https://mywiki.wooledge.org/BashFAQ/035&quot; rel=&quot;ugc nofollow&quot;&gt;BashFAQ/035 - Greg&amp;#039;s Wiki&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:23:01 +0000</pubDate>
        </item>
        <item>
            <title>convertir_une_chaine_de_caracteres_en_tableau</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:convertir_une_chaine_de_caracteres_en_tableau&amp;rev=1732574577&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;convertir_une_chaine_de_caracteres_en_tableau&quot;&gt;Convertir une chaîne de caractères en tableau&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Pour faire cela, il faut utiliser un délimiteur. Il faut faire attention à ce que la chaîne de caractères ne comporte pas d&amp;#039;espace sinon cette technique n&amp;#039;est pas valable.
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Conversion du premier délimiteur (&amp;quot;|&amp;quot;) en &amp;quot; &amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;tableau&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;${chaine/|/ }&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Conversion de tous les délimiteurs (&amp;quot;|&amp;quot;) en &amp;quot; &amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;tableau&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;${chaine//|/ }&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Les parenthèses indiquent qu&#039;il faut traiter le contenu comme un tableau&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:42:57 +0000</pubDate>
        </item>
        <item>
            <title>expansion</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:expansion&amp;rev=1732573514&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;expansion&quot;&gt;Expansion&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
L&amp;#039;expansion des accolades&lt;sup&gt;&lt;a href=&quot;#fn__1&quot; id=&quot;fnt__1&quot; class=&quot;fn_top&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt; permet à Bash d&amp;#039;interpréter le contenu des accolades pour exécuter les commandes. Ce n&amp;#039;est pas très clair comme ça mais quelques exemples simplifierons la compréhension.
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Listage nommé&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Création de fichier1, fichier3 et fichier8&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Listage séquentiel&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Création de fichier1, fichier2, fichier3 et fichier4&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Listage séquentiel avec incrément&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Création de fichier2, fichier4, fichier6 et fichier8&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Listage séquentiel avec incrément et remplissage&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Création de fichier02, fichier04, fichier06, fichier08 et fichier10&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;02..&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Ce comportement fonctionne aussi avec des lettres
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Listage nommé&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Création de fichierA, fichierC et fichierQ&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;A,C,Q&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Listage séquentiel&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Création de fichierA, fichierB, fichierC et fichierD&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;A..D&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Listage séquentiel avec incrément&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Création de fichierA, fichierC et fichierE&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;A..E..&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Ce comportement est récursif
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Création de fichier0, fichier4, fichier5, fichier6, fichier7, fichier8, fichier10, fichier20 et fichier30&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;touch&lt;/span&gt; fichier&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;,&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;..-&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__1&quot; id=&quot;fn__1&quot; class=&quot;fn_bot&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt; 
&lt;div class=&quot;content&quot;&gt;ou Brace Expansion en anglais&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:25:14 +0000</pubDate>
        </item>
        <item>
            <title>fonction_de_conversion_des_pages_de_manuel</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:fonction_de_conversion_des_pages_de_manuel&amp;rev=1732574693&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;fonction_de_conversion_des_pages_de_manuel&quot;&gt;Fonction de conversion des pages de manuel&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Dans le fichier &lt;code&gt;.bashrc&lt;/code&gt;, il faut ajouter la fonction suivante :
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;man2pdf &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;whatis&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;${1}&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;dev&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;null; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;man&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-Tpdf&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;${1}&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;${1}&lt;/span&gt;.pdf
  &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;  
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:44:53 +0000</pubDate>
        </item>
        <item>
            <title>formatage_du_texte</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:formatage_du_texte&amp;rev=1732574733&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;formatage_du_texte&quot;&gt;Formatage du texte&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Pour formater du texte, il faut utiliser des séquences d&amp;#039;échappement. Ces séquences d&amp;#039;échappement sont composées du caractère d&amp;#039;échappement (représenté par &lt;code&gt;&amp;lt;ESC&amp;gt;&lt;/code&gt;) suivi par une série de nombres séparés par des points-virgules et terminées par la lettre &lt;code&gt;m&lt;/code&gt;. Voici quelques exemples :
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Notation en ascii&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\e[4;31;100mHello world\e[m&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Notation en octal&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\033[4;31;100mHello world\033[m&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Notation en hexa-décimal&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\x1B[4;31;100mHello world\x1B[m&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Chaque nombre a une fonction particulière et peut être combiné avec les autres. Cependant, il y a des combinaisons qui n&amp;#039;ont aucun sens.
&lt;/p&gt;
&lt;div class=&quot;table sectionedit2&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 leftalign&quot; colspan=&quot;2&quot;&gt; Ajout d&amp;#039;attributs                                   &lt;/th&gt;&lt;th class=&quot;col2 leftalign&quot; colspan=&quot;2&quot;&gt; Suppression d&amp;#039;attributs                                                                        &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;th class=&quot;col0 leftalign&quot;&gt; Code               &lt;/th&gt;&lt;th class=&quot;col1 leftalign&quot;&gt; Effet                           &lt;/th&gt;&lt;th class=&quot;col2 leftalign&quot;&gt; Code                     &lt;/th&gt;&lt;th class=&quot;col3 leftalign&quot;&gt; Effet                                                                &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 1                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Mettre en gras                  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 0                        &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler tous les effets &lt;sup&gt;&lt;a href=&quot;#fn__1&quot; id=&quot;fnt__1&quot; class=&quot;fn_top&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 2                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Réduire la luminosité           &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 22                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler la réduction de luminosité                                   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 3                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Mettre en italique              &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 23                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler la mise en italique                                          &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 4                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Souligner avec un trait simple  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 24                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler le soulignement (simple ou double)                           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 5                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Faire clignoter                 &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 25                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler le clignotement                                              &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 7                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Inverser les couleurs           &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 27                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler l&amp;#039;inversion des couleurs                                     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 8                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Cacher                          &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 28                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler le cachement                                                 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 9                  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Barrer                          &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 29                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler le barrement                                                 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 21                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Souligner avec un trait double  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 55                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Annuler le surlignement                                              &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 53                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Surligner avec un trait simple  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;                          &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt;                                                                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;th class=&quot;col0 leftalign&quot; colspan=&quot;2&quot;&gt; Couleur du texte                                    &lt;/th&gt;&lt;th class=&quot;col2 leftalign&quot; colspan=&quot;2&quot;&gt; Couleur du fond                                                                                &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;th class=&quot;col0 leftalign&quot;&gt; Code               &lt;/th&gt;&lt;th class=&quot;col1 leftalign&quot;&gt; Effet                           &lt;/th&gt;&lt;th class=&quot;col2 leftalign&quot;&gt; Code                     &lt;/th&gt;&lt;th class=&quot;col3 leftalign&quot;&gt; Effet                                                                &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 30                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte noir                      &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 40                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond noir                                                            &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 31                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte rouge                     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 41                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond rouge                                                           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 32                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte vert                      &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 42                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond vert                                                            &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 33                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte jaune                     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 43                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond jaune                                                           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 34                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte bleu                      &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 44                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond bleu                                                            &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 35                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte violet                    &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 45                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond violet                                                          &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 36                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte cyan                      &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 46                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond cyan                                                            &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row21&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 37                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte gris clair                &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 47                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond gris clair                                                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row22&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 39                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte par défaut                &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 49                       &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond par défaut                                                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row23&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 90                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte gris foncé                &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 100                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond gris foncé                                                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row24&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 91                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte rouge clair               &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 101                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond rouge clair                                                     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row25&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 92                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte vert clair                &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 102                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond vert clair                                                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row26&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 93                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte jaune clair               &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 103                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond jaune clair                                                     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row27&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 94                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte bleu clair                &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 104                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond bleu clair                                                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row28&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 95                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte violet clair              &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 105                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond violet clair                                                    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row29&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 96                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte cyan clair                &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 106                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond cyan clair                                                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row30&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 97                 &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Texte blanc                     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; 107                      &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; Fond blanc                                                           &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;692-5505&amp;quot;} --&gt;
&lt;p&gt;
Pour plus d&amp;#039;informations, voir les pages suivantes :
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://misc.flogisoft.com/bash/tip_colors_and_formatting&quot; class=&quot;urlextern&quot; title=&quot;https://misc.flogisoft.com/bash/tip_colors_and_formatting&quot; rel=&quot;ugc nofollow&quot;&gt;bash:tip_colors_and_formatting - FLOZz&amp;#039; MISC&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://web.archive.org/web/20190311094012/http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20190311094012/http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux&quot; rel=&quot;ugc nofollow&quot;&gt;Using ANSI Color Codes to Colorize Your Bash Prompt on Linux - BitMote&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Voici un script qui permet d&amp;#039;afficher l&amp;#039;ensemble des combinaisons décrites plus haut à l&amp;#039;exception des suppressions d&amp;#039;attributs :
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;https://www.ainw.org/wiki/doku.php?do=export_code&amp;amp;id=informatique:bash:formatage_du_texte&amp;amp;codeblock=1&quot; title=&quot;Télécharger cet extrait&quot; class=&quot;mediafile mf_sh&quot;&gt;bash-color.sh&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Show all the colors of the rainbow, should be run under bash&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; STYLE &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;seq&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;; &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;53&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; FG &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;seq&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;39&lt;/span&gt;; &lt;span class=&quot;kw2&quot;&gt;seq&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;97&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; BG &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;seq&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;49&lt;/span&gt;; &lt;span class=&quot;kw2&quot;&gt;seq&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;107&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;re2&quot;&gt;CTRL&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${STYLE}&lt;/span&gt;;&lt;span class=&quot;es3&quot;&gt;${FG}&lt;/span&gt;;&lt;span class=&quot;es3&quot;&gt;${BG}&lt;/span&gt;&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-en&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\e[&lt;span class=&quot;es3&quot;&gt;${CTRL}&lt;/span&gt;m&lt;span class=&quot;es3&quot;&gt;${CTRL}&lt;/span&gt;\e[m &amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
  &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Reset&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\e[m&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;/div&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__1&quot; id=&quot;fn__1&quot; class=&quot;fn_bot&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt; 
&lt;div class=&quot;content&quot;&gt;&lt;code&gt;\e[0m&lt;/code&gt; et &lt;code&gt;\e[m&lt;/code&gt; ont le même effet&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:45:33 +0000</pubDate>
        </item>
        <item>
            <title>historique_de_commande</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:historique_de_commande&amp;rev=1732574378&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;historique_de_commande&quot;&gt;Historique de commande&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!!&lt;/code&gt; permet de répéter la dernière commande.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!n&lt;/code&gt; permet de répéter la n&lt;sup&gt;ième&lt;/sup&gt; commande depuis le début de l&amp;#039;historique.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!-n&lt;/code&gt; permet de répéter la n&lt;sup&gt;ième&lt;/sup&gt; commande depuis la fin de l&amp;#039;historique.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;.&lt;/code&gt; permet d&amp;#039;ajouter le dernier argument de la dernière commande sans lancer la commande actuelle.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!$&lt;/code&gt; permet d&amp;#039;ajouter le dernier argument de la dernière commande en lançant la commande actuelle.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!*&lt;/code&gt; permet d&amp;#039;ajouter tous les arguments de la dernière commande.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!foo&lt;/code&gt; ou &lt;code&gt;foo !!&lt;/code&gt; permet de relancer la dernière commande commençant par foo.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!:-&lt;/code&gt; permet de récupérer la dernière commande sans le dernier argument.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;:p&lt;/code&gt; permet d&amp;#039;afficher la commande sans qu&amp;#039;elle se lance.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;!:n&lt;/code&gt; permet de récupérer le n&lt;sup&gt;ième&lt;/sup&gt; argument de la dernière commande.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;:s/old/new/&lt;/code&gt; permet de modifier la commande avant de la lancer.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;^old^new^&lt;/code&gt; permet de modifier la dernière commande avant de la lancer.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Lancement d&#039;une commande de l&#039;historique&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Affichage d&#039;une commande de l&#039;historique&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;:p
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Affichage d&#039;une commande modifiée de l&#039;historique&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;:s&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;old&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;new&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;:p&lt;/pre&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_info plugin_wrap&quot;&gt;
&lt;p&gt;
Pour aller plus loin avec l&amp;#039;historique :
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://www.thegeekstuff.com/2008/08/15-examples-to-master-linux-command-line-history/&quot; class=&quot;urlextern&quot; title=&quot;https://www.thegeekstuff.com/2008/08/15-examples-to-master-linux-command-line-history/&quot; rel=&quot;ugc nofollow&quot;&gt;15 Examples To Master Linux Command Line History&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.tux-planet.fr/ajouter-la-date-et-lheure-dans-lhistorique-de-bash/&quot; class=&quot;urlextern&quot; title=&quot;http://www.tux-planet.fr/ajouter-la-date-et-lheure-dans-lhistorique-de-bash/&quot; rel=&quot;ugc nofollow&quot;&gt;Ajouter la date et l&amp;#039;heure dans l&amp;#039;historique de bash - Tux-planet&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://sanctum.geek.nz/arabesque/better-bash-history/&quot; class=&quot;urlextern&quot; title=&quot;https://sanctum.geek.nz/arabesque/better-bash-history/&quot; rel=&quot;ugc nofollow&quot;&gt;Better Bash history | Arabesque&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps&quot; class=&quot;urlextern&quot; title=&quot;https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps&quot; rel=&quot;ugc nofollow&quot;&gt;How To Use Bash History Commands and Expansions&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://blog.macromates.com/2008/working-with-history-in-bash/&quot; class=&quot;urlextern&quot; title=&quot;http://blog.macromates.com/2008/working-with-history-in-bash/&quot; rel=&quot;ugc nofollow&quot;&gt;TextMate Blog » Working With History in Bash&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:39:38 +0000</pubDate>
        </item>
        <item>
            <title>liens</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:liens&amp;rev=1732574780&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;liens&quot;&gt;Liens&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://stackoverflow.com/questions/3427872/whats-the-difference-between-and-in-bash&quot; class=&quot;urlextern&quot; title=&quot;https://stackoverflow.com/questions/3427872/whats-the-difference-between-and-in-bash&quot; rel=&quot;ugc nofollow&quot;&gt;What&amp;#039;s the difference between [ and [[ in Bash?&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html&quot; class=&quot;urlextern&quot; title=&quot;http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html&quot; rel=&quot;ugc nofollow&quot;&gt;Bash Beginners Guide&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://tldp.org/LDP/abs/html/&quot; class=&quot;urlextern&quot; title=&quot;http://tldp.org/LDP/abs/html/&quot; rel=&quot;ugc nofollow&quot;&gt;Advanced Bash Scripting Guide&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.bashoneliners.com/&quot; class=&quot;urlextern&quot; title=&quot;http://www.bashoneliners.com/&quot; rel=&quot;ugc nofollow&quot;&gt;Bash One-Liners&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.faqs.org/docs/bashman/bashref.html&quot; class=&quot;urlextern&quot; title=&quot;http://www.faqs.org/docs/bashman/bashref.html&quot; rel=&quot;ugc nofollow&quot;&gt;Bash Reference Manual&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.tldp.org/LDP/abs/html/options.html&quot; class=&quot;urlextern&quot; title=&quot;http://www.tldp.org/LDP/abs/html/options.html&quot; rel=&quot;ugc nofollow&quot;&gt;Options&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://wiki.bash-hackers.org/&quot; class=&quot;urlextern&quot; title=&quot;https://wiki.bash-hackers.org/&quot; rel=&quot;ugc nofollow&quot;&gt;The Bash Hackers Wiki [Bash Hackers Wiki]&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://devhints.io/bash&quot; class=&quot;urlextern&quot; title=&quot;https://devhints.io/bash&quot; rel=&quot;ugc nofollow&quot;&gt;Bash scripting cheatsheet&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://shellmagic.xyz/&quot; class=&quot;urlextern&quot; title=&quot;https://shellmagic.xyz/&quot; rel=&quot;ugc nofollow&quot;&gt;Shell Magic - The Ultimate Bash Cheatsheet!&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:46:20 +0000</pubDate>
        </item>
        <item>
            <title>manipuler_des_nombres</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:manipuler_des_nombres&amp;rev=1732574531&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;manipuler_des_nombres&quot;&gt;Manipuler des nombres&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Additions &lt;sup&gt;&lt;a href=&quot;#fn__2&quot; id=&quot;fnt__2&quot; class=&quot;fn_top&quot;&gt;2)&lt;/a&gt;&lt;/sup&gt; &lt;sup&gt;&lt;a href=&quot;#fn__3&quot; id=&quot;fnt__3&quot; class=&quot;fn_top&quot;&gt;3)&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Addition d&#039;entiers&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i + &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Incrémentation d&#039;une variable&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i++&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Addition de réels&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Ce n&#039;est pas supporté directement. Il faut passer par d&#039;autres outils (awk, python, ...).&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;BEGIN {print &lt;span class=&quot;es2&quot;&gt;$i&lt;/span&gt;+3; exit}&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Changer de base&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Pour changer en base 10&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;co0&quot;&gt;#$i))&lt;/span&gt;&lt;/pre&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_info plugin_wrap&quot;&gt;
&lt;p&gt;
Un nombre avec des 0 devant est considéré comme un nombre en octal. Lorsqu&amp;#039;il sera utilisé pour faire des additions, les résultats ne seront pas ceux attendus. Dans ce cas, il faut lire le nombre en décimal, ce qui as pour effet de supprimer les 0.
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Afficher une séquence&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Affiche 1 2 3 4 5 6 7 8 9 10&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;..&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$i&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Affiche 01 02 03 04 05 06 07 08 09 10&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;01..&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$i&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Cette méthode n&#039;est à utiliser qu&#039;avec une version de Bash antérieure à la 3.5&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Affiche 1 2 3 4 5 6 7 8 9 10&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;seq&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;`&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$i&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__2&quot; id=&quot;fn__2&quot; class=&quot;fn_bot&quot;&gt;2)&lt;/a&gt;&lt;/sup&gt; 
&lt;div class=&quot;content&quot;&gt;&lt;a href=&quot;https://stackoverflow.com/a/6348941&quot; class=&quot;urlextern&quot; title=&quot;https://stackoverflow.com/a/6348941&quot; rel=&quot;ugc nofollow&quot;&gt;How can I add numbers in a bash script?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__3&quot; id=&quot;fn__3&quot; class=&quot;fn_bot&quot;&gt;3)&lt;/a&gt;&lt;/sup&gt; 
&lt;div class=&quot;content&quot;&gt;&lt;a href=&quot;https://askubuntu.com/questions/385528/how-to-increment-a-variable-in-bash&quot; class=&quot;urlextern&quot; title=&quot;https://askubuntu.com/questions/385528/how-to-increment-a-variable-in-bash&quot; rel=&quot;ugc nofollow&quot;&gt;How to increment a variable in bash? - Ask Ubuntu&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:42:11 +0000</pubDate>
        </item>
        <item>
            <title>manipuler_un_tableau</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:manipuler_un_tableau&amp;rev=1732574428&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;manipuler_un_tableau&quot;&gt;Manipuler un tableau&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Déclaration&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# déclaration implicite élément par élément&lt;/span&gt;
tab&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;=valeur_1
tab&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;=valeur_2
tab&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;=valeur_3
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# déclaration implicite de l&#039;ensemble des valeurs&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;tab&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;valeur_1 valeur_2 valeur_3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# déclaratin explicite de l&#039;ensemble des valeurs&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;declare&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;tab&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;valeur_1 valeur_2 valeur_3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Ajouter un élément&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Au début du tableau&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;tab&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;valeur_0 &lt;span class=&quot;co1&quot;&gt;${tab[@]}&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# À la fin du tableau&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;tab&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;${tab[@]}&lt;/span&gt; valeur_4&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Parcourir les éléments séquentiellement&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${tab[@]}&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;co0&quot;&gt;# faire quelque chose&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Récupérer le nombre d&amp;#039;éléments&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;${#tab[@]}&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.yourownlinux.com/2013/10/working-with-arrays-in-bash-scripting.html&quot; class=&quot;urlextern&quot; title=&quot;http://www.yourownlinux.com/2013/10/working-with-arrays-in-bash-scripting.html&quot; rel=&quot;ugc nofollow&quot;&gt;Pour aller plus loin&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:40:28 +0000</pubDate>
        </item>
        <item>
            <title>manipuler_une_chaine_de_characteres</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:manipuler_une_chaine_de_characteres&amp;rev=1732574480&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;manipuler_une_chaine_de_characteres&quot;&gt;Manipuler une chaîne de charactères&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Ajout d&amp;#039;une valeur par défaut&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co1&quot;&gt;${chaine:-default}&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Extraction d&amp;#039;une sous-chaîne&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# À partir d&#039;une position jusqu&#039;à la fin de la chaîne&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine:debut}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# À partir d&#039;une position pour une longueur donnée&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine:debut:longueur}&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Conversion en tableau&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;re2&quot;&gt;tableau&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re1&quot;&gt;$chaine&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Extraire l&amp;#039;extension d&amp;#039;un fichier&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;re2&quot;&gt;extension&lt;/span&gt;=&lt;span class=&quot;co1&quot;&gt;${chaine##*.}&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Substituer une sous-chaîne par une autre&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Remplacement du premier points par un espace (attention à l&#039;espace dans la chaîne de substitution)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine/./ }&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Remplacement des points par des espaces (attention à l&#039;espace dans la chaîne de substitution)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine//./ }&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Extraire une sous-chaîne par rapport à un séparateur&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Extraire avant le séparateur (|)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine%|*}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Extraire après le séparateur (|)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine#*|}&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Changer la casse&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Convertir le premier caractère en majuscule&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine^}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Convertir tous les caractères en majuscule&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine^^}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Convertir le premier caractère en minuscule&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine,}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Convertir tous les caractères en minuscule&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine,,}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Inverser la casse du premier caractère&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine~}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Inverser la casse de tous les caractères&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;${chaine~~}&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.tldp.org/LDP/abs/html/string-manipulation.html&quot; class=&quot;urlextern&quot; title=&quot;http://www.tldp.org/LDP/abs/html/string-manipulation.html&quot; rel=&quot;ugc nofollow&quot;&gt;Pour aller plus loin&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:41:20 +0000</pubDate>
        </item>
        <item>
            <title>raccourcis_clavier</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:raccourcis_clavier&amp;rev=1732574624&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;raccourcis_clavier&quot;&gt;Raccourcis clavier&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
&lt;a href=&quot;https://www.ainw.org/wiki/lib/exe/fetch.php?media=informatique:bash_sheet.png&quot; class=&quot;media&quot; title=&quot;informatique:bash_sheet.png&quot;&gt;&lt;img src=&quot;https://www.ainw.org/wiki/lib/exe/fetch.php?media=informatique:bash_sheet.png&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://jamesconner.us/images/bash_sheet.png&quot; class=&quot;urlextern&quot; title=&quot;http://jamesconner.us/images/bash_sheet.png&quot; rel=&quot;ugc nofollow&quot;&gt;source&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:43:44 +0000</pubDate>
        </item>
        <item>
            <title>recuperer_le_retour_de_la_derniere_commande</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:recuperer_le_retour_de_la_derniere_commande&amp;rev=1732574656&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;recuperer_le_retour_de_la_derniere_commande&quot;&gt;Récupérer le retour de la dernière commande&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re4&quot;&gt;$?&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:44:16 +0000</pubDate>
        </item>
        <item>
            <title>redirection</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:redirection&amp;rev=1732573468&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;redirection&quot;&gt;Redirection&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Les redirections permettent de stocker les sorties d&amp;#039;un programme dans un fichier. Si le fichier n&amp;#039;existe pas, celui ci est créé. Par défaut, seulement la sortie standard est stockée.
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Le contenu du fichier est supprimé avant la redirection&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Le contenu de la redirection est ajouté à la fin du fichier&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Il est possible également de stocker la sortie d&amp;#039;erreur dans un fichier :
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# On stocke seulement les erreurs&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; error
&lt;span class=&quot;co0&quot;&gt;# On stocke la sortie standard et les erreurs dans des fichiers différents&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; error
&lt;span class=&quot;co0&quot;&gt;# On stocke la sortie standard et les erreurs dans le même fichier&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Les redirections peuvent se faire n&amp;#039;importe où dans la commande&lt;sup&gt;&lt;a href=&quot;#fn__4&quot; id=&quot;fnt__4&quot; class=&quot;fn_top&quot;&gt;4)&lt;/a&gt;&lt;/sup&gt; :
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Toutes les commandes suivantes sont équivalentes&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; arg1 arg2 &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; arg1 &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt; arg2
&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt; arg1 arg2
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; arg1 arg2&lt;/pre&gt;

&lt;/div&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__4&quot; id=&quot;fn__4&quot; class=&quot;fn_bot&quot;&gt;4)&lt;/a&gt;&lt;/sup&gt; 
&lt;div class=&quot;content&quot;&gt;&lt;a href=&quot;http://www.catonmat.net/blog/bash-redirections/&quot; class=&quot;urlextern&quot; title=&quot;http://www.catonmat.net/blog/bash-redirections/&quot; rel=&quot;ugc nofollow&quot;&gt;All these bash redirections are equal&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:24:28 +0000</pubDate>
        </item>
        <item>
            <title>variables_d_environnement</title>
            <link>https://www.ainw.org/wiki/doku.php?id=informatique:bash:variables_d_environnement&amp;rev=1732573427&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;variables_d_environnement&quot;&gt;Variables d&amp;#039;environnement&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Il est possible d&amp;#039;ajouter, de modifier et de supprimer des variables d&amp;#039;environnement qui peuvent être utilisées par le système ou les commandes lancées.
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Ajouter ou modifier une variable d&#039;environnement&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;variable&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;=&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Supprimer une variable d&#039;environnement&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;unset&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;variable&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Lancer une commande en modifiant localement la variable d&#039;environnement&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;variable&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;=&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_alert plugin_wrap&quot;&gt;
&lt;p&gt;
Dans certains contexte (&lt;em&gt;cron&lt;/em&gt; par exemple), l&amp;#039;utilisateur qui lance la commande ne possède pas les mêmes variables d&amp;#039;environnement que l&amp;#039;utilisateur connecté. Pour identifier ce problème, il est possible de lancer la commande dans un environnement vierge avec la commande suivante :
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Version courte&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;env&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Version longue&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;env&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;--ignore-environment&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Dans le cas de &lt;em&gt;cron&lt;/em&gt;, il est possible d&amp;#039;en extraire son environnement d&amp;#039;exécution et de le ré-utiliser pour le lancement manuel de la commande :
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Ajouter temporairement cette ligne dans cron pour générer le fichier d&#039;environnement&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; root &lt;span class=&quot;kw2&quot;&gt;env&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; ~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;cronenv
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Lancer la commande en utilisant le contenu du fichier précédemment généré&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;env&lt;/span&gt; - $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;cronenv&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;sh&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 25 Nov 2024 22:23:47 +0000</pubDate>
        </item>
    </channel>
</rss>
