<?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=381543&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / [resolu] créer un alias avec paramètre]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=381543</link>
		<description><![CDATA[Les sujets les plus récents dans [resolu] créer un alias avec paramètre.]]></description>
		<lastBuildDate>Tue, 16 Apr 2013 12:21:55 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=13234061#p13234061</link>
			<description><![CDATA[<p>oh mon Dieu oui, j&#039;avais tenté le <strong>;</strong> mais à l&#039;extérieur des <strong>{}</strong> <img src="http://forum.ubuntu-fr.org/img/smilies/roll.png" width="15" height="15" alt="roll" /></p><p>merci ^^</p>]]></description>
			<author><![CDATA[dummy@example.com (tiresias)]]></author>
			<pubDate>Tue, 16 Apr 2013 12:21:55 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=13234061#p13234061</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=13224991#p13224991</link>
			<description><![CDATA[<p>Bonjour tiresias,<br />La commande entre <strong>&quot;{ }&quot;</strong> doit se terminer par <strong>&quot;;&quot;</strong>.</p><div class="codebox"><pre><code>function grepi() { grep -iInr &quot;$1&quot; . ;}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 15 Apr 2013 12:46:07 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=13224991#p13224991</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=13224851#p13224851</link>
			<description><![CDATA[<p>Bonjour,<br />(et désolé pour le déterrage <img src="http://forum.ubuntu-fr.org/img/smilies/hmm.png" width="15" height="15" alt="hmm" />)<br />J&#039;ai tenté ceci dans mon .bashrc: </p><div class="codebox"><pre><code>function grepi() { grep -iInr &quot;$1&quot; . }</code></pre></div><p>et lorsque j&#039;ouvre un nouveau terminal j&#039;ai (la ligne 52 est la fin du fichier bashrc et la fonction se trouve ligne 26...)</p><div class="codebox"><pre><code>-bash: /home/moi/.bashrc: line 52: syntax error: unexpected end of file</code></pre></div><p>mais sans succès... Quelqu&#039;un aurait une idée du problème svp?</p>]]></description>
			<author><![CDATA[dummy@example.com (tiresias)]]></author>
			<pubDate>Mon, 15 Apr 2013 12:29:28 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=13224851#p13224851</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3306641#p3306641</link>
			<description><![CDATA[<p>Ok parfait merci beaucoup <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (antoine4)]]></author>
			<pubDate>Sat, 27 Feb 2010 13:46:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3306641#p3306641</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3306046#p3306046</link>
			<description><![CDATA[<p>Oui, tu as raison !<br />Cordialement,<br />Guy</p>]]></description>
			<author><![CDATA[dummy@example.com (gl38)]]></author>
			<pubDate>Sat, 27 Feb 2010 08:06:28 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3306046#p3306046</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305752#p3305752</link>
			<description><![CDATA[<p>ton alias cdl=&quot;cd ; ls&quot; fait ceci :<br />cdl dossier/<br />lancer la commande cd ; ls $1 dossier/ :<br /> - un cd → cd sans argument = cd ~/<br /> - ls dossier/ (car $1 = une chaîne vide)</p><p>ça fait <span class="bbu">en apparence</span> une partie de ce que tu veux mais en réalité rien de bon</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Fri, 26 Feb 2010 23:01:04 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305752#p3305752</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305742#p3305742</link>
			<description><![CDATA[<p>Ahh je viens de comprendre <img src="http://forum.ubuntu-fr.org/img/smilies/lol.png" width="15" height="15" alt="lol" /></p>]]></description>
			<author><![CDATA[dummy@example.com (wido)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:53:59 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305742#p3305742</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305735#p3305735</link>
			<description><![CDATA[<p>donc c&#039;est bien ce que je disais ça ne fonctionne pas car ce n&#039;est pas prévu pour…<br />alias → pas d&#039;arguments (cf <a href="./viewtopic.php?pid=3305676#p3305676">ce post</a>)<br />function → arguments</p><p>après vous faites comme vous voulez mais ne vous étonnez pas si ça plante <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>ps. pour les tétus :<br /><strong>man bash</strong></p><div class="codebox"><pre><code>ALIASES

       […]
       There is no mechanism for using arguments in the replacement text.   If
       arguments  are  needed,  a shell function should be used (see FUNCTIONS
       below).</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:49:52 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305735#p3305735</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305728#p3305728</link>
			<description><![CDATA[<p>C&#039;est vrai que ça ne change pas de directory à la fin, mais le résultat du ls est bon.<br />Ça ressemble aux variables locales et globales.<br />Mais là c&#039;est un peu tard pour que je réfléchisse sérieusement à ces subtilités.<br />À demain.</p>]]></description>
			<author><![CDATA[dummy@example.com (gl38)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:47:07 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305728#p3305728</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305726#p3305726</link>
			<description><![CDATA[<p>Tu veux que ça donne quoi avec tes commandes?</p>]]></description>
			<author><![CDATA[dummy@example.com (wido)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:46:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305726#p3305726</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305704#p3305704</link>
			<description><![CDATA[<p>et bien avec la même version de bash je peux te confirmer que cela ne fonctionne pas…</p><p>lance cette suite de commande pour t&#039;en convaincre (dans un teminal tout neuf) :</p><div class="codebox"><pre><code>alias cdl=&quot;cd $1; ls&quot;
pwd
cd Documents
cdl ~/Bureau
pwd</code></pre></div><p>tiens le dossier n&#039;est pas le bon…</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:31:39 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305704#p3305704</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305693#p3305693</link>
			<description><![CDATA[<p>l&#039;exemple, c&#039;est celui que j&#039;ai donné plus haut<br />alias cdl=&#039;cd $1; ls&#039;<br />je peux le mettre en ligne de commande ou dans le .bashrc (et puis je tape source .bashrc).<br />Si je tape <br />cdl /home<br />cdl .<br />cdl ..<br />j&#039;obtiens ce qu&#039;on peut attendre de cette commande.<br />Pour la version, synaptic me dit qu&#039;il&#160; a installé bash4.0-5ubuntu2.<br />Pour être honnête, à 20h40 je ne savais pas que ça marcherait !!<br />Cordialement,<br />Guy</p>]]></description>
			<author><![CDATA[dummy@example.com (gl38)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:26:36 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305693#p3305693</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305676#p3305676</link>
			<description><![CDATA[<p>tu peux me donner un exemple gl38 ? et ton shell avec sa version ?</p><p>une démo comme quoi les alias ne prennent pas d&#039;argument avec bash :</p><div class="codebox"><pre><code>$ alias testarg=&quot;echo $2&quot;
$ testarg a b
a b</code></pre></div><p>en revanche</p><div class="codebox"><pre><code>$ function testarg2 () { echo $2; }
$ testarg2 a b
b</code></pre></div><p><img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>les alias ne prennent pas d&#039;argument, le shell remplace juste l&#039;alias par sa définition, donc :</p><div class="codebox"><pre><code>ALIAS arg1 arg2 etc.</code></pre></div><p>sera remplacé par</p><div class="codebox"><pre><code>DÉFINITION_DE_L_ALIAS arg1 arg2 etc.</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:19:25 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305676#p3305676</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305670#p3305670</link>
			<description><![CDATA[<p>Mais si, mais si, les alias prennent les arguments !<br />Faut essayer !<br />Les 2 solutions données fonctionnent avec ; ou |</p>]]></description>
			<author><![CDATA[dummy@example.com (gl38)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:17:45 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305670#p3305670</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [resolu] créer un alias avec paramètre]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305659#p3305659</link>
			<description><![CDATA[<p>j&#039;avais oublié l&#039;espace entre <strong>{</strong> et <strong>cd</strong> (important), c&#039;est corrigé et cela fonctionne <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>ps. si tu as déjà défini un alias avec le même nom il faut relancer nouveau terminal sinon l&#039;alias prendra le dessus sur la fonction…</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Fri, 26 Feb 2010 22:12:53 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3305659#p3305659</guid>
		</item>
	</channel>
</rss>
