<?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=1117611&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / [Résolu] renvoi inattendu par "cut"]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=1117611</link>
		<description><![CDATA[Les sujets les plus récents dans [Résolu] renvoi inattendu par "cut".]]></description>
		<lastBuildDate>Sat, 12 Jan 2013 16:10:07 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12181751#p12181751</link>
			<description><![CDATA[<p>bonne année à tous !! bien noté<br />@pingouinux<br />oui je lis la doc trop en biais ... et je ne la connais plus suffisamment ,<br />il y a quelques années on disait -c = caractères ... <img src="http://forum.ubuntu-fr.org/img/smilies/sad.png" width="15" height="15" alt="sad" /><br />-c compte le nombre d&#039;octets<br />-m compte le nombre de caractères<br />@nesthib<br />oui j&#039;étais parti sur autre chose un seul suffit</p><div class="codebox"><pre><code>echo &quot;ññññ&quot;|wc -m
5</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (ar barzh paour)]]></author>
			<pubDate>Sat, 12 Jan 2013 16:10:07 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12181751#p12181751</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12181601#p12181601</link>
			<description><![CDATA[<p>+1</p><p>petite question, pourquoi faire un :</p><div class="codebox"><pre><code>echo `echo…`</code></pre></div><p>c&#039;est inutile, non ?</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Sat, 12 Jan 2013 15:52:19 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12181601#p12181601</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12181391#p12181391</link>
			<description><![CDATA[<p>Bonjour ar barzh paour,<br />C&#039;est normal, il faut utiliser <strong>-m</strong> au lieu de <strong>-c</strong>. Voici un extrait de <strong>man wc</strong> :</p><div class="quotebox"><blockquote><div><p>-c, --bytes<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; print the byte counts</p><p>&#160; &#160; &#160; &#160;-m, --chars<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; print the character counts</p></div></blockquote></div><div class="codebox"><pre><code>$ wc -c &lt;&lt;&lt;&quot;ééé&quot;
7

$ wc -m &lt;&lt;&lt;&quot;ééé&quot;
4</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Sat, 12 Jan 2013 15:36:30 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12181391#p12181391</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12180631#p12180631</link>
			<description><![CDATA[<p>ah bien je trouve aussi ceci</p><div class="codebox"><pre><code>echo `echo &quot;ñ&quot;|wc -c`
3</code></pre></div><p>si on tient compte d&#039;un éventuel saut de ligne je devrait obtenir 2 et non 3<br />je confirme par </p><div class="codebox"><pre><code>echo `echo &quot;ññññ&quot;|wc -c`
9</code></pre></div><p>wc compte bien 2 caractères pour le ñ !!!! et non 1</p>]]></description>
			<author><![CDATA[dummy@example.com (ar barzh paour)]]></author>
			<pubDate>Sat, 12 Jan 2013 14:29:32 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12180631#p12180631</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11675631#p11675631</link>
			<description><![CDATA[<p>je mets résolu<br />en effet &quot;cut&quot; est buggé (post #4 de nethib)<br />et on m&#039;a donné un paliatif (post #3 Watael) (post #6 pingouinux)<br />et plein d&#039;explications ....<br />@nesthib<br />j&#039;ai essayé de relancer le bug en ajoutant un commentaire sur launchpad(2012-11-29)<br />à+</p>]]></description>
			<author><![CDATA[dummy@example.com (ar barzh paour)]]></author>
			<pubDate>Thu, 29 Nov 2012 07:40:06 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11675631#p11675631</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11655091#p11655091</link>
			<description><![CDATA[<p>@elendil<br />super ! merci pour le lien<br />pour info j&#039;y ai même trouvé une version plus récente <a href="http://abs.traduc.org/abs-6.4.05-fr/">le meme en 6.4.05</a></p>]]></description>
			<author><![CDATA[dummy@example.com (ar barzh paour)]]></author>
			<pubDate>Tue, 27 Nov 2012 14:12:54 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11655091#p11655091</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11654711#p11654711</link>
			<description><![CDATA[<p>Salut,</p><p>Juste pour compléter cette page : <a href="http://abs.traduc.org/abs-5.0-fr/ch09s02.html">http://abs.traduc.org/abs-5.0-fr/ch09s02.html</a> m&#039;a souvent beaucoup aidée...</p><p>Elendil</p>]]></description>
			<author><![CDATA[dummy@example.com (elendil)]]></author>
			<pubDate>Tue, 27 Nov 2012 13:30:33 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11654711#p11654711</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11652641#p11652641</link>
			<description><![CDATA[<p>@nethib et pingouinux , je ne pense jamais aux solutions les plus simples !<br />man bash !!!!!! c&#039;est si simple j&#039;y vais<br />et merci pour l&#039;explication des &quot;&lt;&lt;&lt;&quot;</p><div class="quotebox"><cite>BrunoGey a écrit&#160;:</cite><blockquote><div><p>echo &quot;$1&quot;|cut -c1-${#2}, le #2 entre crochets, compte 2 lettres depuis la fin du mot, pour donner tañ</p></div></blockquote></div><p>non dans mon post 5 je développe un peu plus<br />1 est le premier paramètre reçu par la fonction<br />2 est le deuxième paramètre reçu par la fonction</p><p>en bash&#160; &#160; {#2} donne la longueur du paramètre N°2<br /> si la fontion deb_mot_OK recoit comme deuxième paramètre tañv<br /> {#2} a comme valeur 4</p><p>exemple</p><div class="codebox"><pre><code>#!/bin/bash
function deb_mot_OK {	
echo &quot;longueur :&quot; ${#1} &quot;(paramètre 1 =$1)&quot;
echo &quot;longueur :&quot; ${#2} &quot;(paramètre 2 =$2)&quot;
}
deb_mot_OK &quot;123456789&quot; &quot;tañv&quot;
read g</code></pre></div><p>le résultat donne</p><div class="codebox"><pre><code>longueur : 9 (paramètre 1 =123456789)
longueur : 4 (paramètre 2 =tañv)</code></pre></div><p>il faut remarquer que ${#2}&#160; avec 2=tañv donne bien 4</p>]]></description>
			<author><![CDATA[dummy@example.com (ar barzh paour)]]></author>
			<pubDate>Tue, 27 Nov 2012 09:15:00 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11652641#p11652641</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11651081#p11651081</link>
			<description><![CDATA[<p>@ar barzh paour : pour relancer le bug il suffit de suivre mon précédent lien et de poster un commentaire comme quoi tu es aussi affecté. Pour la syntaxe ${parameter:offset:length}, tu trouveras tous les détails dans le man de <strong>bash</strong> à la section <strong>Parameter Expansion</strong>.</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Tue, 27 Nov 2012 01:27:56 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11651081#p11651081</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11650321#p11650321</link>
			<description><![CDATA[<p>en effet.</p><p>${#2} est le nombre de caractères contenu dans le deuxième paramètre postitionnel.</p>]]></description>
			<author><![CDATA[dummy@example.com (Watael)]]></author>
			<pubDate>Mon, 26 Nov 2012 23:04:28 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11650321#p11650321</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647661#p11647661</link>
			<description><![CDATA[<div class="quotebox"><cite>ar barzh paour a écrit&#160;:</cite><blockquote><div><p>bonjour à tous<br />voilà un résultat que je n&#039;attendais pas </p><div class="codebox"><pre><code>xxx@-desktop:~$ echo &quot;tañva&quot;|cut -c1-4
tañ</code></pre></div><p>je m&#039;attendais à obtenir &quot;tañv&quot; bien sur et <br />je me demandais pourquoi mon programme ne fonctionnait pas<br />en fait le code exact de mon programme est celui-ci :</p><div class="codebox"><pre><code>res=`echo &quot;$1&quot;|cut -c1-${#2}`</code></pre></div><p>auriez-vous une solution ?</p></div></blockquote></div><p>Bonsoir,</p><p>j&#039;espère ne pas dire une connerie, sinon rectifiez svp.<br />voilà :<br />mon sentiment est que tañva&quot;|cut -c1-4, compte 4 lettres depuis le dbut du mot pour donner&#160; tañv<br />alors que echo &quot;$1&quot;|cut -c1-${#2}, le #2 entre crochets, compte 2 lettres depuis la fin du mot, pour donner tañ</p><p>ta syntaxe ${#num}, est différente de -num</p><p>d&#039;accord ?</p><p>cdt</p><p>bruno</p>]]></description>
			<author><![CDATA[dummy@example.com (BrunoGey)]]></author>
			<pubDate>Mon, 26 Nov 2012 19:53:53 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647661#p11647661</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647351#p11647351</link>
			<description><![CDATA[<div class="quotebox"><cite>ar barzh paour a écrit&#160;:</cite><blockquote><div><p>que veulent dire les &quot;&lt;&lt;&lt;&quot; ?</p></div></blockquote></div><p>Le texte à droite de <strong>&lt;&lt;&lt;</strong> est transmis à la commande en tant que &quot;standard input&quot;.</p><p>Extrait de <strong>man bash<br /></strong></p><div class="quotebox"><blockquote><div><p>Here Strings<br />&#160; &#160; &#160; &#160;A variant of here documents, the format is:</p><p>&#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;&lt;&lt;word</p><p>&#160; &#160; &#160; &#160;The word is expanded and supplied to the command on its standard input.</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 26 Nov 2012 19:25:29 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647351#p11647351</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647261#p11647261</link>
			<description><![CDATA[<p>bonsoir pingouinux<br />oui ça marche aussi <br />que veulent dire les &quot;&lt;&lt;&lt;&quot; ? je connaissais &quot;&lt;&quot; et &quot;&lt;&lt;&quot; mais pas &quot;&lt;&lt;&lt;&quot;</p>]]></description>
			<author><![CDATA[dummy@example.com (ar barzh paour)]]></author>
			<pubDate>Mon, 26 Nov 2012 19:19:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647261#p11647261</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647131#p11647131</link>
			<description><![CDATA[<p>Bonsoir,<br />Ceci devrait être équivalent :</p><div class="codebox"><pre><code>if grep -q &quot;^$2&quot; &lt;&lt;&lt;&quot;$1&quot;
then
  return 0
else
  return 1
fi</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 26 Nov 2012 19:08:24 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11647131#p11647131</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] renvoi inattendu par "cut"]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11646571#p11646571</link>
			<description><![CDATA[<p>@watael : oui je suis en bash&#160; j&#039;ai modifié mon code ainsi :</p><div class="codebox"><pre><code>function deb_mot_OK {	
			#recoit	
			#	$1=ligne dans laquelle rechercher le mot
			#	$2=début du mot à chercher
			# code de retour
				#0 si début de la ligne est égal au mot à chercher
				#1 sinon
res=`echo &quot;${1:0:${#2}}&quot;`
if [[ $res = $2 ]]
then
     return 0
else
     return 1
fi
}</code></pre></div><p>ça à l&#039;air de tourner impec !<br />où puis-je trouver cette documentation qui explique cette syntaxe ?</p><p>@nethib<br />oui ñ=C3 B1<br />je vais me renseigner pour savoir comment relancer un bug, car je ne sais pas faire</p>]]></description>
			<author><![CDATA[dummy@example.com (ar barzh paour)]]></author>
			<pubDate>Mon, 26 Nov 2012 18:37:08 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11646571#p11646571</guid>
		</item>
	</channel>
</rss>
