<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=377290&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=377290</link>
		<description><![CDATA[Les sujets les plus récents dans [resolu]bash, comment afficher des éléments du prompt à droite ?.]]></description>
		<lastBuildDate>Wed, 24 Feb 2010 10:27:29 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3299526#p3299526</link>
			<description><![CDATA[<div class="quotebox"><cite>sputnick a écrit&#160;:</cite><blockquote><div><p>Totor, c&#039;est quoi tes caracteres d&#039;échapement ?</p></div></blockquote></div><p><a href="http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html">http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html</a></p>]]></description>
			<author><![CDATA[dummy@example.com (jofab)]]></author>
			<pubDate>Wed, 24 Feb 2010 10:27:29 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3299526#p3299526</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3297877#p3297877</link>
			<description><![CDATA[<p>Je dirait meme plus simple : </p><div class="codebox"><pre><code>printf &#039;%*s\n&#039; $COLUMNS &quot;ceci est a droite&quot;</code></pre></div><p>Totor, c&#039;est quoi tes caracteres d&#039;échapement ?</p>]]></description>
			<author><![CDATA[dummy@example.com (sputnick)]]></author>
			<pubDate>Tue, 23 Feb 2010 15:16:05 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3297877#p3297877</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3297128#p3297128</link>
			<description><![CDATA[<p>Merci pour vos réponses. <br />Jo</p>]]></description>
			<author><![CDATA[dummy@example.com (jofab)]]></author>
			<pubDate>Tue, 23 Feb 2010 08:57:06 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3297128#p3297128</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3261434#p3261434</link>
			<description><![CDATA[<p>Bonjour,<br />Sinon, pour aligner un texte à droite de la console :</p><div class="codebox"><pre><code>droite=&quot;le texte à aligner à droite&quot;
printf &quot;\r\033[$(($(tput cols)-${#droite}))C${droite}&quot;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Totor)]]></author>
			<pubDate>Sat, 06 Feb 2010 11:56:52 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3261434#p3261434</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260588#p3260588</link>
			<description><![CDATA[<p>un sudo apt-get install zsh est bien plus rapide quand meme <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /> </p><p>Mais bon j&#039;avais déjà fait la demande ici </p><p>Cela resemble a cela :</p><p>┌─→(n3o@matrix——————————————(~)<br />@<br />└─→(22:47)─&gt;$&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; (22:47:44)</p><p>Ligne = a n3o@ avec le newPWD a la fin pour remplacer /home/n3o par ~ <br />Ligne debut = a la date&#160; jusqu&#039;au $ </p><p>enfin ligne de fin a l&#039;uptime </p><p>enfin une boucle avec while qui ajoute des - afin d&#039;avoir toute la longueur du terminal en fonction de la taille</p>]]></description>
			<author><![CDATA[dummy@example.com (n3o51)]]></author>
			<pubDate>Fri, 05 Feb 2010 21:01:02 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260588#p3260588</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260568#p3260568</link>
			<description><![CDATA[<p>sympa n3o51 ^^ je ne connaissais pas le RPROMPT</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Fri, 05 Feb 2010 20:51:47 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260568#p3260568</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260543#p3260543</link>
			<description><![CDATA[<p>@ n3o51 &gt; c&#039;est mignon ton truc mais<br />meme pour moi qui connais à peu pres la syntaxe du bouzin<br />ça nous aide pas franchement : j&#039;ai pas trouvé ou était défini tes lignes</p>]]></description>
			<author><![CDATA[dummy@example.com (Qid)]]></author>
			<pubDate>Fri, 05 Feb 2010 20:45:22 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260543#p3260543</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260522#p3260522</link>
			<description><![CDATA[<p>Bonsoir </p><div class="codebox"><pre class="vscroll"><code>#!/bin/bash
function setPrompt()
{
VERT=&quot;\[\033[1;32m\]&quot;
ROUGE=&quot;\[\e[31;1m\]&quot;
JAUNE=&quot;\[\e[33;1m\]&quot;
BLEU=&quot;\[\e[34;1m\]&quot;
ROSE=&quot;\[\e[35;1m\]&quot;
CYAN=&quot;\[\e[36;1m\]&quot;
BLANC=&quot;\[\e[37;1m\]&quot;
RESET=&quot;\[\e[0m\]&quot;

newPWD=$(sed &quot;s=$HOME=~=&quot; &lt;&lt;&lt; &quot;${PWD}&quot;)

DATE=$(date +&quot; %d/%m/%Y&quot;)
TIME=$(date +%H:%M)
#UPTIME1=$(uptime | sed &#039;s/.*up *\([0-9: ]*\(min\|day\)*\([s]\{0,1\},[0-9: ]*\)\{0,1\}\),[0-9 ]*user.*/\1/&#039;)
UPTIME1=$(uptime | sed &#039;s/.*up *\([0-9: ]*\(min[ ]*\|day[s]*\)*\(,[0-9: ]*\(min[ ]*\)*\)*\),[0-9 ]*user.*/\1/&#039;)

LIGNE=&quot;┌─→(${USER}@${HOSTNAME}${DATE})(${newPWD})&quot;

MAX_COLUMNS=$((COLUMNS-1))
FILL=&quot;&quot;
while [ ${#LIGNE} -lt ${MAX_COLUMNS} ];
do
  FILL=&quot;-${FILL}&quot;
  LIGNE=&quot;${LIGNE} &quot;
done

LIGNE1=&quot;${JAUNE}┌─→(${RESET}${VERT}${USER}${RESET}${JAUNE}@${RESET}${VERT}${HOSTNAME}${RESET}${VERT}${DATE}${RESET}${JAUNE})${FILL}(${RESET}${CYAN}${newPWD}${RESET}${JAUNE})&quot;
LIGNE3_FIN=&quot;(${UPTIME1})&quot;
LIGNE3_DEBUT=&quot;└─→(${TIME})─&gt;&quot;

FILL=&quot;&quot;
while [ ${#LIGNE3_FIN} -lt ${MAX_COLUMNS} ];
do
  LIGNE3_FIN=&quot; ${LIGNE3_FIN}&quot;
  FILL=&quot; ${FILL}&quot;
done
LIGNE3_FIN=&quot;${FILL}${JAUNE}(${RESET}${CYAN}${UPTIME1}${RESET}${JAUNE})${RESET}${BLANC}&quot;
PS1=&quot;${LIGNE1}\n@\n${LIGNE3_FIN}\r\[\033[1;32m\]${LIGNE3_DEBUT}&quot;
}</code></pre></div><p>tu enregistre le script </p><p>tu ajoute dans ton bashrc :</p><div class="codebox"><pre><code>. ~/script/setPrompt.sh
PROMPT_COMMAND=setPrompt</code></pre></div><p>le script tu le nomme setPrompt.sh et modifie le chemin pour qu&#039;il te coresspond et amuse toi bien <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (n3o51)]]></author>
			<pubDate>Fri, 05 Feb 2010 20:39:25 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260522#p3260522</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260488#p3260488</link>
			<description><![CDATA[<div class="quotebox"><cite>nesthib a écrit&#160;:</cite><blockquote><div><p>je n&#039;ai pas trop compris ce que tu veux faire jofab… tu peux donner un exemple ?</p></div></blockquote></div><p>facil :<br /><span class="postimg"><img src="http://www.golden-gryphon.com/blog/manoj//images/prompt.png" alt="prompt.png" /></span></p>]]></description>
			<author><![CDATA[dummy@example.com (Qid)]]></author>
			<pubDate>Fri, 05 Feb 2010 20:24:53 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260488#p3260488</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260458#p3260458</link>
			<description><![CDATA[<p>le PS2 c&#039;est ce qui définit le caractère de continuation de ligne :</p><div class="codebox"><pre><code>user@host:~$ echo &#039;
&gt; ← c&#039;est celui là</code></pre></div><p>le PS3 c&#039;est celui qui est utilisé par la commande <strong>select</strong> :</p><div class="codebox"><pre><code>user@host:~$ select choix in a b c ; do echo $choix ; break ; done
1) a
2) b
3) c
#? ← c&#039;est le PS3</code></pre></div><p>après je n&#039;ai pas trop compris ce que tu veux faire jofab… tu peux donner un exemple ?</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Fri, 05 Feb 2010 20:05:35 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260458#p3260458</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260282#p3260282</link>
			<description><![CDATA[<p>il me semble que c&#039;est PS2 ou 3 (justement pas le 1 <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" />)</p>]]></description>
			<author><![CDATA[dummy@example.com (Qid)]]></author>
			<pubDate>Fri, 05 Feb 2010 18:32:46 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3260282#p3260282</guid>
		</item>
		<item>
			<title><![CDATA[[resolu]bash, comment afficher des éléments du prompt à droite ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3259581#p3259581</link>
			<description><![CDATA[<p>Bonjour,<br />&#160; qqn sais comment faire l&#039;equivalent de la variable RPROMPT de zsh sous bash (qui permet d&#039;afficher des éléments du prompt à droite) ?<br />&#160; Merci<br />Jo</p><p><em>edit modo : merci d&#039;utiliser des titres plus explicites</em><br /><em>edit jo : ok, désolé <img src="http://forum.ubuntu-fr.org/img/smilies/hmm.png" width="15" height="15" alt="hmm" /> </em></p>]]></description>
			<author><![CDATA[dummy@example.com (jofab)]]></author>
			<pubDate>Fri, 05 Feb 2010 14:03:26 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3259581#p3259581</guid>
		</item>
	</channel>
</rss>
