<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Void And Any &#187; bashrc</title>
	<atom:link href="http://voidandany.free.fr/index.php/tag/bashrc/feed/" rel="self" type="application/rss+xml" />
	<link>http://voidandany.free.fr</link>
	<description>mon bazar...</description>
	<lastBuildDate>Sat, 09 Dec 2017 09:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Astuce bash : la variable HISTCONTROL</title>
		<link>http://voidandany.free.fr/index.php/astuce-bash-la-variable-histcontrol/</link>
		<comments>http://voidandany.free.fr/index.php/astuce-bash-la-variable-histcontrol/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 18:25:32 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bashrc]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2491</guid>
		<description><![CDATA[Sur la page man de bash on peut lire ceci concernant la variable HISTCONTROL : HISTCONTROL Une liste de valeurs, séparées par des  deux-points,  commandant la  façon  dont  les  commandes  sont  sauvegardées dans la file d’historique.  Si  la  liste  des  &#8230; <a href="http://voidandany.free.fr/index.php/astuce-bash-la-variable-histcontrol/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-2553" style="margin-left: 10px; margin-right: 10px;" title="shell_97002957_27f6bdfe17_z" src="http://voidandany.free.fr/wp-content/uploads/shell_97002957_27f6bdfe17_z-300x225.jpg" alt="" width="300" height="225" />Sur la <a href="http://manpages.ubuntu.com/manpages/lucid/fr/man1/bash.1.html">page man de bash</a> on peut lire ceci concernant la variable HISTCONTROL :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">HISTCONTROL
 Une liste de valeurs, séparées par des  deux-points,  commandant
 la  façon  dont  les  commandes  sont  sauvegardées dans la file
 d’historique.  Si  la  liste  des  valeurs  contient  la  valeur
 ignorespace,  les  lignes  commençant par une espace ne sont pas
 sauvegardées dans la file  d’historique.  La  valeur  ignoredups
 conduit  à ne pas sauvegarder une ligne correspondant exactement
 à la ligne de commande précédente. La présence de ignoreboth est
 un  condensé pour ignorespace et ignoredups. La valeur erasedups
 conduit à retirer de la  file  d’historique  toutes  les  lignes
 précédant la ligne courante et lui correspondant avant que cette
 ligne y soit sauvegardée. Toute valeur qui ne fait pas partie de
 la  liste  ci-dessus est ignorée. Si HISTCONTROL est inexistante
 ou si elle ne contient  pas  une  valeur  correcte,  toutes  les
 lignes   lues   par   l’analyseur   de   l’interpréteur   seront
 sauvegardées dans la  file  d’historique,  selon  la  valeur  de
 HISTIGNORE.  La  seconde  ligne  et les suivantes d’une commande
 multiligne  ne  sont  pas  testées   et   sont   ajoutées   dans
 l’historique indépendamment de la valeur de HISTCONTROL.</pre></div></div>

<p><br class="spacer_" /></p>
<p>Voici quelques test pour ce rendre compte du comportement de l&#8217;historique en fonction de la valeur de HISTCONTROL.</p>
<p><br class="spacer_" /></p>
<h3>HISTCONTROL = ignoredup</h3>
<p>En mode ignoredup on tape cd temp / cd .. / cd temp / cd ..</p>
<p>Contenu de l&#8217;historique :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">539  cd temp
540  cd ..
541  cd temp
542  cd ..</pre></div></div>

<p><br class="spacer_" /></p>
<p>Par contre si on tape on tape cd temp /cd downloads / cd .. / cd .. on aura :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">544  cd temp
545  cd downloads/
546  cd ..</pre></div></div>

<p>Les <span style="font-weight: bold;">commandes identiques consécutives sont regroupées</span></p>
<p><br class="spacer_" /></p>
<h3>HISTCONTROL = erasedup</h3>
<p>En mode erasedups on tape cd temp / cd .. / cd temp / cd ..</p>
<p>Contenu de l&#8217;historique :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">550  cd temp
551  cd ..</pre></div></div>

<p><br class="spacer_" /></p>
<p>Qu&#8217;une seule ligne cd temp et cd .. a été gardé (les dernières) toutes <span style="font-weight: bold;">les précédentes</span> préalablement présentes/tapés (539-541, 544, 546) <span style="font-weight: bold;">ont été supprimées</span>.</p>
<p><br class="spacer_" /></p>
<h3>HISTCONTROL = ignorespace</h3>
<p>En mode ignorespace on saisie cd temp et cd .. précédé d&#8217;un espace</p>
<p>Contenu de l&#8217;historique :<br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">552  cd temp</pre></div></div>

<p>La commande cd &#8230; (précédée d&#8217;un espace) n&#8217;apparait pas</p>
<p><br class="spacer_" /></p>
<h3>HISTCONTROL = ignoreboth</h3>
<p>ignoreboth est un condensé pour ignorespace et ignoredups</p>
<p><br class="spacer_" /></p>
<h3>Mon Choix</h3>
<p>HISTCONTROL=erasedups:ignorespace</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/astuce-bash-la-variable-histcontrol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quelques prompts glanés sur le web</title>
		<link>http://voidandany.free.fr/index.php/quelques-prompts-glannes-sur-le-web/</link>
		<comments>http://voidandany.free.fr/index.php/quelques-prompts-glannes-sur-le-web/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 22:23:01 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[PS1]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2762</guid>
		<description><![CDATA[En attendant de faire un article sur mon prompt (que je n&#8217;ai pas encore créé), Voici quelques prompts trouvés sur le Web lors de mes recherches. Vous retrouverez le mien encore plus beau et plus pratique ;o) ici :  Mon &#8230; <a href="http://voidandany.free.fr/index.php/quelques-prompts-glannes-sur-le-web/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: line-through;">En attendant de faire un article sur mon prompt (que je n&#8217;ai pas encore créé), </span></p>
<p>Voici quelques prompts trouvés sur le Web lors de mes recherches.</p>
<p>Vous retrouverez le mien encore plus beau et plus pratique ;o) ici :   <a title="Mon Prompt : le plus beau des prompts" rel="bookmark" href="../index.php/mon-prompt-le-plus-beau-des-prompts/">Mon Prompt : le plus beau des prompts</a></p>
<div></div>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">'${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '</span></pre></div></div>

<p style="text-align: center;"><img class="aligncenter size-full wp-image-2763" title="prompt Ubuntu" src="../wp-content/uploads/S%C3%A9lection_0171.png" alt="" width="186" height="20" /><span style="font-size: xx-small;"> </span></p>
<p style="text-align: center;"><span style="font-size: xx-small;">Source : Prompt par défaut sous Ubuntu</span></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> 
&nbsp;
<span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;\[\033[0;33m\][\!]\<span style="color: #780078;">`if [[ \$? = &quot;0&quot; ]]; then echo &quot;\\[\\033[32m\\]&quot;; else echo &quot;\\[\\033[31m\\]&quot;; fi\`</span>[\u.\h: \<span style="color: #780078;">`if [[ `</span>pwd|wc -c|tr -d &quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">` &gt; 18 ]]; then echo &quot;\\W&quot;; else echo &quot;\\w&quot;; fi\`</span>]<span style="color: #000099; font-weight: bold;">\$</span>\[\033[0m\] &quot;</span>; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">&quot;\033]0;<span style="color: #780078;">`hostname -s`</span>:<span style="color: #780078;">`pwd`</span>\007&quot;</span></pre></div></div>

<p style="text-align: center;"><img class="size-full wp-image-2767 aligncenter" title="Sélection_021" src="http://voidandany.free.fr/wp-content/uploads/Sélection_021.png" alt="" width="325" height="22" /></p>
<p style="text-align: left;">Et en cas  d&#8217;erreur :</p>
<p style="text-align: center;"><img class="size-full wp-image-2768 aligncenter" title="Sélection_022" src="http://voidandany.free.fr/wp-content/uploads/Sélection_022.png" alt="" width="419" height="38" /><span style="font-size: xx-small;"> </span></p>
<p style="text-align: center;"><span style="font-size: xx-small;">Source : <a href="http://blog.ubrio.us/nix/best-bash-prompt/#high_3">http://blog.ubrio.us/nix/best-bash-prompt/#high_3</a></span></p>
<p>J&#8217;aime : le changement de couleur en cas d&#8217;erreur, le numéro d&#8217;historique, la coupure des chemins &gt; 18 caractères, le titre du terminal</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">GRAY</span>=<span style="color: #ff0000;">&quot;\[\033[1;30m\]&quot;</span>
<span style="color: #007800;">LIGHT_GRAY</span>=<span style="color: #ff0000;">&quot;\[\033[0;37m\]&quot;</span>
<span style="color: #007800;">CYAN</span>=<span style="color: #ff0000;">&quot;\[\033[0;36m\]&quot;</span>
<span style="color: #007800;">LIGHT_CYAN</span>=<span style="color: #ff0000;">&quot;\[\033[1;36m\]&quot;</span>
<span style="color: #007800;">NO_COLOUR</span>=<span style="color: #ff0000;">&quot;\[\033[0m\]&quot;</span>
<span style="color: #007800;">temp</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>tty<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">GRAD1</span>=<span style="color: #800000;">${temp:5}</span>
<span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$TITLEBAR</span><span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$GRAY</span>-<span style="color: #007800;">$CYAN</span>-<span style="color: #007800;">$LIGHT_CYAN</span>(<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$CYAN</span>\u<span style="color: #007800;">$GRAY</span>@<span style="color: #007800;">$CYAN</span>\h<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$LIGHT_CYAN</span>)<span style="color: #007800;">$CYAN</span>-<span style="color: #007800;">$LIGHT_CYAN</span>(<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$CYAN</span>\#<span style="color: #007800;">$GRAY</span>/<span style="color: #007800;">$CYAN</span><span style="color: #007800;">$GRAD1</span><span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$LIGHT_CYAN</span>)<span style="color: #007800;">$CYAN</span>-<span style="color: #007800;">$LIGHT_CYAN</span>(<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$CYAN</span><span style="color: #000099; font-weight: bold;">\$</span>(date +%H%M)<span style="color: #007800;">$GRAY</span>/<span style="color: #007800;">$CYAN</span><span style="color: #000099; font-weight: bold;">\$</span>(date +%d-%b-%y)<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$LIGHT_CYAN</span>)<span style="color: #007800;">$CYAN</span>-<span style="color: #007800;">$GRAY</span>-<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$LIGHT_GRAY</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$GRAY</span>-<span style="color: #007800;">$CYAN</span>-<span style="color: #007800;">$LIGHT_CYAN</span>(<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$CYAN</span><span style="color: #000099; font-weight: bold;">\$</span><span style="color: #007800;">$GRAY</span>:<span style="color: #007800;">$CYAN</span>\w<span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">$LIGHT_CYAN</span>)<span style="color: #007800;">$CYAN</span>-<span style="color: #007800;">$GRAY</span>-<span style="color: #007800;">$LIGHT_GRAY</span> &quot;</span></pre></div></div>

<p style="text-align: center;"><img class="size-full wp-image-2764 aligncenter" title="prompt" src="http://voidandany.free.fr/wp-content/uploads/Sélection_018.png" alt="" width="463" height="40" /><span style="font-size: xx-small;"> </span></p>
<p style="text-align: center;"><span style="font-size: xx-small;">Source : <a href="http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html#AEN343">http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html#AEN343</a></span></p>
<p>J&#8217;aime : les couleurs, les deux lignes, la date/heure mais pas sous ce format</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">txtrst</span>=<span style="color: #ff0000;">'\e[0m'</span>    <span style="color: #666666; font-style: italic;"># Text Reset</span>
<span style="color: #007800;">txtbluj</span>=<span style="color: #ff0000;">&quot;\[\e[01;34m\]&quot;</span> <span style="color: #666666; font-style: italic;"># Bleu prompt</span>
<span style="color: #007800;">txtarobasc</span>=<span style="color: #ff0000;">&quot;\[\e[05;33m\]&quot;</span> <span style="color: #666666; font-style: italic;"># Orange clignote prompt</span>
<span style="color: #007800;">txtarobas</span>=<span style="color: #ff0000;">&quot;\[\e[02;33m\]&quot;</span> <span style="color: #666666; font-style: italic;"># Orange prompt</span>
<span style="color: #007800;">txtvertj</span>=<span style="color: #ff0000;">&quot;\[\e[01;32m\]&quot;</span> <span style="color: #666666; font-style: italic;"># Vert fluo prompt</span>
<span style="color: #007800;">txtjaunj</span>=<span style="color: #ff0000;">&quot;\[\e[01;33m\]&quot;</span> <span style="color: #666666; font-style: italic;"># Jaune prompt</span>
<span style="color: #007800;">txtbleucj</span>=<span style="color: #ff0000;">&quot;\[\033[1;36m\]&quot;</span> <span style="color: #666666; font-style: italic;"># Bleu clair prompt</span>
<span style="color: #007800;">txtheure</span>=<span style="color: #ff0000;">&quot;\[\e[02;36m\]&quot;</span> <span style="color: #666666; font-style: italic;"># turquoise, heure prompt</span>
<span style="color: #007800;">txtgrisj</span>=<span style="color: #ff0000;">&quot;\[\e[30;1m\]&quot;</span> <span style="color: #666666; font-style: italic;"># gris prompt</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #007800;">${txtbluj}</span>\u<span style="color: #007800;">${txtrst}</span><span style="color: #007800;">${txtarobasc}</span>@<span style="color: #007800;">${txtrst}</span><span style="color: #007800;">${txtvertj}</span>\h<span style="color: #007800;">${txtrst}</span>:<span style="color: #007800;">${txtjaunj}</span>\w <span style="color: #007800;">${txtrst}</span>(<span style="color: #007800;">${txtbleucj}</span><span style="color: #007800;">$(ls -1 | wc -l | sed 's: ::g')</span> fichiers <span style="color: #007800;">${txtjaunj}</span><span style="color: #007800;">$(ls -lah | grep -m 1 total | sed 's/total //')</span>b<span style="color: #007800;">${txtrst}</span>) <span style="color: #007800;">${txtrst}</span><span style="color: #007800;">${txtbleucj}</span>[<span style="color: #000099; font-weight: bold;">\t</span>]<span style="color: #007800;">${txtgrisj}</span> #\#<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #007800;">${txtgrisj}</span>(jobs:<span style="color: #007800;">${txtbluj}</span>\j<span style="color: #007800;">${txtgrisj}</span>)\<span style="color: #780078;">`if [ \$? = &quot;0&quot; ]; then echo '${txtvertj} :-)'; else echo '${bldred} :-(' ; fi\`</span><span style="color: #007800;">${txtrst}</span><span style="color: #000099; font-weight: bold;">\n</span>$&quot;</span></pre></div></div>

<p style="text-align: center;"><img class="size-full wp-image-2765 aligncenter" title="prompt" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0191.png" alt="" width="437" height="57" /><span style="font-size: xx-small;"> </span></p>
<p style="text-align: center;"><span style="font-size: xx-small;">Source : <a href="Source%20:%20http://www.bordel-de-nerd.net/2010/08/configurer-son-terminal-bash">http://www.bordel-de-nerd.net/2010/08/configurer-son-terminal-base</a></span></p>
<p>J&#8217;aime : le numéro d&#8217;historique discret, l&#8217;heure, le concept du smiley qui change de couleur en cas d&#8217;erreur</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Color Variables for Prompt</span>
<span style="color: #007800;">GRAD1</span>=<span style="color: #ff0000;">'\333\262\261\260'</span>
<span style="color: #007800;">GRAD2</span>=<span style="color: #ff0000;">'\260\261\262\333'</span>
<span style="color: #007800;">YLOBRN</span>=<span style="color: #ff0000;">'\[\033[01;33;43m\]'</span>
<span style="color: #007800;">WHTBRN</span>=<span style="color: #ff0000;">'\[\033[01;37;43m\]'</span>
<span style="color: #007800;">REDBRN</span>=<span style="color: #ff0000;">'\[\033[01;31;43m\]'</span>
<span style="color: #007800;">BLUBRN</span>=<span style="color: #ff0000;">'\[\033[01;34;43m\]'</span>
<span style="color: #007800;">GRNBRN</span>=<span style="color: #ff0000;">'\[\033[00;32;43m\]'</span>
<span style="color: #007800;">REDBLK</span>=<span style="color: #ff0000;">'\[\033[00;31;40m\]'</span>
<span style="color: #007800;">PPLBLK</span>=<span style="color: #ff0000;">'\[\033[01;35;40m\]'</span>
<span style="color: #007800;">WHTBLK</span>=<span style="color: #ff0000;">'\[\033[01;37;40m\]'</span>
<span style="color: #007800;">NONE</span>=<span style="color: #ff0000;">'\[\033[00m\]'</span>
<span style="color: #007800;">HBLK</span>=<span style="color: #ff0000;">'\[\033[00;30;30m\]'</span>
<span style="color: #007800;">HBLU</span>=<span style="color: #ff0000;">'\[\033[01;34;34m\]'</span>
<span style="color: #007800;">BLU</span>=<span style="color: #ff0000;">'\[\033[01;34m\]'</span>
<span style="color: #007800;">YEL</span>=<span style="color: #ff0000;">'\[\033[01;33m\]'</span>
<span style="color: #007800;">WHT</span>=<span style="color: #ff0000;">'\[\033[01;37m\]'</span>
<span style="color: #007800;">PRPL</span>=<span style="color: #ff0000;">'\[\033[00;35m\]'</span>
<span style="color: #007800;">RED</span>=<span style="color: #ff0000;">'\[\033[01;31m\]'</span>
<span style="color: #007800;">GRN</span>=<span style="color: #ff0000;">'\[\033[01;32m\]'</span>          
<span style="color: #007800;">GRAY</span>=<span style="color: #ff0000;">'\[\033[01;30m\]'</span>
<span style="color: #007800;">PINK</span>=<span style="color: #ff0000;">'\[\033[01;35m\]'</span>
<span style="color: #007800;">NORM</span>=<span style="color: #ff0000;">'\[\033[01;00;0m\]'</span>
<span style="color: #007800;">CYAN</span>=<span style="color: #ff0000;">'\[\033[01;36m\]'</span>
<span style="color: #7a0874; font-weight: bold;">export</span> GRAD1 GRAD2 YLOBRN WHTBRN REDBRN
BLUBRN GRNBRN REDBLK PPLBLK WHTBLK NONE
HBLK HBLU BLU YEL WHT PRPL RED GRN GRAY
PINK NORM CYAN
<span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$CYAN</span>[\s]<span style="color: #007800;">$YEL</span>[<span style="color: #000099; font-weight: bold;">\t</span>] <span style="color: #007800;">$GRN</span>\u<span style="color: #007800;">$YEL</span>@<span style="color: #007800;">$BLU</span>\h <span style="color: #007800;">$WHT</span>[\w]<span style="color: #000099; font-weight: bold;">\$</span><span style="color: #007800;">$NONE</span> <span style="color: #007800;">$NORM</span>&quot;</span></pre></div></div>

<p style="text-align: center;"><img class="size-full wp-image-2766 aligncenter" title="Sélection_020" src="http://voidandany.free.fr/wp-content/uploads/Sélection_020.png" alt="" width="324" height="23" /><span style="font-size: xx-small;"> </span></p>
<p style="text-align: center;"><span style="font-size: xx-small;">Source : <a href="http://www.linuxquestions.org/questions/linux-from-scratch-13/why-does-debian-host-decide-to-ignore-ps1-variable-449425/#post2287912">http://www.linuxquestions.org/questions/linux-from-scratch-13/why-does-debian-host-decide-to-ignore-ps1-variable-449425/#post2287912</a></span></p>
<p>J&#8217;aime : l&#8217;heure</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">'\n\[\033[1;34m\]\342\226\210\342\226\210 \u @ \w\n\[\033[0;36m\]\342\226\210\342\226\210 \t $ \[\033[0;39m\]'</span></pre></div></div>

<p style="text-align: center;"><img class="size-full wp-image-2769 aligncenter" title="Sélection_023" src="http://voidandany.free.fr/wp-content/uploads/Sélection_023.png" alt="" width="146" height="45" /><span style="font-size: xx-small;"> </span></p>
<p style="text-align: center;"><span style="font-size: xx-small;">Source : <a href="http://ubuntulife.wordpress.com/2010/07/14/top-7-de-prompts-para-la-terminal/">http://ubuntulife.wordpress.com/2010/07/14/top-7-de-prompts-para-la-terminal/</a></span></p>
<p>J&#8217;aime : les couleurs, les 2 lignes, l&#8217;heure, les carrés, la sobriété, c&#8217;est visuellement le plus beau</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><strong>Rque :</strong> l&#8217;ajout du caractère : au début du prompt et de ; à la fin permet de sélectionner toute la ligne de  commande par un triple clic sur la ligne et de pouvoir la coller en ayant le prompt d&#8217;ignoré :</p>
<p>Sans</p>
<p style="text-align: center;"><img class="size-full wp-image-2775 aligncenter" title="prompt 1" src="http://voidandany.free.fr/wp-content/uploads/prompt-11.gif" alt="" width="444" height="197" /><br class="spacer_" /></p>
<p>Avec</p>
<p style="text-align: center;"><img class="size-full wp-image-2776 aligncenter" title="prompt 2" src="http://voidandany.free.fr/wp-content/uploads/prompt-21.gif" alt="" width="444" height="197" /></p>
<p>Source :<a href="http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html#AEN784">http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html#AEN784</a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/quelques-prompts-glannes-sur-le-web/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Astuce Bash : Prise en compte des fichiers . par le bash</title>
		<link>http://voidandany.free.fr/index.php/astuce-bash-prise-en-compte-des-fichiers-par-le-bash/</link>
		<comments>http://voidandany.free.fr/index.php/astuce-bash-prise-en-compte-des-fichiers-par-le-bash/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 22:09:56 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bashrc]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2562</guid>
		<description><![CDATA[Je continue mon bashrc et par la même occasion je continue de décrire ici mes découvertes : Cette fois ci il s&#8217;agit de la prise en compte ou non des fichiers / dossiers cachés, commençant par un point par les &#8230; <a href="http://voidandany.free.fr/index.php/astuce-bash-prise-en-compte-des-fichiers-par-le-bash/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/shell_97002957_27f6bdfe17_z.jpg"><img class="alignleft size-medium wp-image-2553" style="margin-left: 10px; margin-right: 10px;" title="shell_97002957_27f6bdfe17_z" src="http://voidandany.free.fr/wp-content/uploads/shell_97002957_27f6bdfe17_z-300x225.jpg" alt="" width="300" height="225" /></a>Je continue mon bashrc et par la même occasion je continue de décrire ici mes découvertes :<br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Cette fois ci il s&#8217;agit de la <span style="font-weight: bold;">prise en compte</span> ou non des <span style="font-weight: bold;">fichiers / dossiers cachés</span>, commençant par un point <span style="font-weight: bold;">par les caractère génériques</span>.</p>
<p><br class="spacer_" /></p>
<p>Un exemple sera plus parlant.</p>
<p><br class="spacer_" /></p>
<p>Soit dans un répertoire, 2 fichiers l&#8217;un nommé <span style="font-style: italic;">&laquo;&nbsp;essai</span>&nbsp;&raquo; et l&#8217;autre <span style="font-style: italic;">&laquo;&nbsp;.essai</span>&nbsp;&raquo; (OK c&#8217;est un exemple donc un peu débile).</p>
<p>Par défaut si vous listez les fichiers finissant par <span style="font-style: italic;">&laquo;&nbsp;ssai&nbsp;&raquo;</span> en utilisant le caractère générique * vous aurez ceci :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>ssai
 essai</pre></div></div>

<p><br class="spacer_" /></p>
<p>Sauf si positionnez l&#8217;option <span style="font-weight: bold;">dotglob </span>avec la commande <span style="font-weight: bold;">shopt </span>:</p>

<div class="wp_syntax"><div class="code"><pre class="avisynth" style="font-family:monospace;">shopt <span style="color:#006600; font-weight:bold;">-</span>s dotglob</pre></div></div>

<p><br class="spacer_" /></p>
<p>Dès lors le comportement de la commande précédente à changée :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>ssai
 essai  .essai</pre></div></div>

<p><br class="spacer_" /></p>
<p><em><strong>Source : </strong></em></p>
<p><a title="Permalink to Configurer son terminal Bash" href="http://www.bordel-de-nerd.net/2010/08/configurer-son-terminal-bash/#content">Configurer son terminal Bash</a></p>
<p><a href="http://wiki.mandriva.com/fr/Fichiers_et_r%C3%A9pertoires_cach%C3%A9s#Solution_3_:_activer_la_reconnaissance_par_le_shell_du_point_initial">Fichiers et répertoires cachés &#8211; Wiki de la communauté Mandriva</a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/astuce-bash-prise-en-compte-des-fichiers-par-le-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astuce Bash : Sauvegarder dans l&#8217;historique les commandes multi-ligne</title>
		<link>http://voidandany.free.fr/index.php/astuce-bash-sauvegarder-dans-lhistorique-les-commandes-multi-ligne/</link>
		<comments>http://voidandany.free.fr/index.php/astuce-bash-sauvegarder-dans-lhistorique-les-commandes-multi-ligne/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 07:03:53 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bashrc]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2560</guid>
		<description><![CDATA[Suite des astuces bashrc. Si vous tapez l&#8217;ensemble de commandes suivantes dans votre terminal : for i in 1 2 3 4 5 do echo &#34;Welcome $i times&#34; done Et que vous utilisez les flèches haut et bas pour naviguer &#8230; <a href="http://voidandany.free.fr/index.php/astuce-bash-sauvegarder-dans-lhistorique-les-commandes-multi-ligne/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/shell_97002957_27f6bdfe17_z.jpg"><img class="alignleft size-medium wp-image-2553" style="margin-left: 10px; margin-right: 10px;" title="shell_97002957_27f6bdfe17_z" src="http://voidandany.free.fr/wp-content/uploads/shell_97002957_27f6bdfe17_z-300x225.jpg" alt="" width="300" height="225" /></a>Suite des astuces bashrc.</p>
<p><br class="spacer_" /></p>
<p>Si vous tapez l&#8217;ensemble de commandes suivantes dans votre terminal :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">1</span> <span style="color: #000000;">2</span> <span style="color: #000000;">3</span> <span style="color: #000000;">4</span> <span style="color: #000000;">5</span>
<span style="color: #000000; font-weight: bold;">do</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Welcome <span style="color: #007800;">$i</span> times&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Et que vous utilisez les flèches haut et bas pour naviguer dans votre historique vous aurez successivement les différentes lignes :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/ss-cmdhist.gif"><img class="size-full wp-image-2579 aligncenter" title="sans cmdhist" src="http://voidandany.free.fr/wp-content/uploads/ss-cmdhist.gif" alt="" width="660" height="469" /></a><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Sauf si vous avez la ligne suivante dans votre .bashrc</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">shopt</span> <span style="color: #660033;">-s</span> cmdhist</pre></div></div>

<p><br class="spacer_" /></p>
<p>La commande multi-ligne est sauvegardée comme une ligne unique dans l&#8217;historique :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/avec-cmdhist.gif"><img class="size-full wp-image-2580 aligncenter" title="avec cmdhist" src="http://voidandany.free.fr/wp-content/uploads/avec-cmdhist.gif" alt="" width="660" height="469" /></a></p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: left;"><span style="text-decoration: underline;"><em><strong>Source : </strong></em></span></p>
<p style="text-align: left;"><a title="Permalink to Configurer son terminal Bash" href="http://www.bordel-de-nerd.net/2010/08/configurer-son-terminal-bash/#content">Configurer son terminal Bash</a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/astuce-bash-sauvegarder-dans-lhistorique-les-commandes-multi-ligne/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astuce Bash : Corriger automatiquement les fautes de frappe</title>
		<link>http://voidandany.free.fr/index.php/astuce-bash-corriger-automatiquement-les-fautes-de-frappe/</link>
		<comments>http://voidandany.free.fr/index.php/astuce-bash-corriger-automatiquement-les-fautes-de-frappe/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 11:26:56 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bashrc]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2552</guid>
		<description><![CDATA[Je suis actuellement en train de refaire mon .bashrc, l&#8217;ancien ne satisfaisant pas tout a fait surtout après avoir lu l&#8217;excellent article Configurer son terminal Bash de bordel de nerd Bref je reprends chacune des configurations que j&#8217;ai dans mon &#8230; <a href="http://voidandany.free.fr/index.php/astuce-bash-corriger-automatiquement-les-fautes-de-frappe/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/shell_97002957_27f6bdfe17_z.jpg"><img class="alignleft size-medium wp-image-2553" style="margin-left: 10px; margin-right: 10px;" title="shell_97002957_27f6bdfe17_z" src="http://voidandany.free.fr/wp-content/uploads/shell_97002957_27f6bdfe17_z-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Je suis actuellement en train de refaire mon <span style="font-weight: bold;">.bashrc</span>, <a href="http://voidandany.free.fr/index.php/ubuntu-minimal-bashrc/">l&#8217;ancien</a> ne satisfaisant pas tout a fait surtout après avoir lu l&#8217;excellent article <a title="Permalink to Configurer son terminal Bash" href="http://www.bordel-de-nerd.net/2010/08/configurer-son-terminal-bash/#content">Configurer son terminal Bash</a> de bordel de nerd<br class="spacer_" /></p>
<p>Bref je reprends chacune des configurations que j&#8217;ai dans mon .bashrc je les compare et ajoute avec celle de bordel de nerd, ce qui est l&#8217;occasion pour moi de découvrir pas mal de chose dont je compte faire des petits articles.</p>
<p><br class="spacer_" /></p>
<p>Pour commencer une astuce spéciale gros doigts.</p>
<p>Si vous avez pour fâcheuse tendance à<span style="font-weight: bold;"> inverser des lettres</span> dans les <span style="font-weight: bold;">chemins </span>que vous tapez, vous allez être content, plus jamais de :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>daat
<span style="color: #c20cb9; font-weight: bold;">bash</span>: <span style="color: #7a0874; font-weight: bold;">cd</span>: <span style="color: #000000; font-weight: bold;">/</span>daat: Aucun fichier ou dossier de ce <span style="color: #7a0874; font-weight: bold;">type</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>Pour mettre en place l&#8217;astuce, très simple il suffit d&#8217;ajouter la ligne suivante à votre ~/.bashrc :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">shopt</span> <span style="color: #660033;">-s</span> cdspell</pre></div></div>

<p><br class="spacer_" /></p>
<p>Et maintenant si vous vous trompez, miracle :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>sweetBox:~$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>daat
<span style="color: #000000; font-weight: bold;">/</span>data
user<span style="color: #000000; font-weight: bold;">@</span>sweetBox:<span style="color: #000000; font-weight: bold;">/</span>data$</pre></div></div>

<p><br class="spacer_" /></p>
<p style="font-weight: bold; font-style: italic;">Rque :</p>
<p>Pour supprimer l&#8217;option :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">shopt</span> <span style="color: #660033;">-u</span> cdspell</pre></div></div>

<p>Pour lister les option possibles :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">shopt</span>
autocd          off
cdable_vars     off
cdspell         on
checkhash       off
checkjobs       off
checkwinsize    off
cmdhist         on
compat31        off
compat32        off
compat40        off
dirspell        off
dotglob         off
execfail        off
expand_aliases  on
extdebug        off
extglob         on
extquote        on
failglob        off
force_fignore   on
globstar        off
gnu_errfmt      off
histappend      on
histreedit      off
histverify      off
hostcomplete    off
huponexit       off
interactive_comments    on
lithist         off
login_shell     off
mailwarn        off
no_empty_cmd_completion off
nocaseglob      off
nocasematch     off
nullglob        off
progcomp        on
promptvars      on
restricted_shell        off
shift_verbose   off
sourcepath      on
xpg_echo        off
 </pre></div></div>

<p style="font-weight: bold; font-style: italic;">Sources :</p>
<p>Image par <a href="http://www.flickr.com/photos/christinamatheson/">Christina Matheson</a> sous CC BY-NC-SA</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/astuce-bash-corriger-automatiquement-les-fautes-de-frappe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
