<?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=1183721&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / Symbole de l'IFS]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=1183721</link>
		<description><![CDATA[Les sujets les plus récents dans Symbole de l'IFS.]]></description>
		<lastBuildDate>Thu, 31 Jan 2013 23:10:25 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12418201#p12418201</link>
			<description><![CDATA[<p>OK, merci.<br />En plus il peut y avoir plusieurs caractères.... très intéressant...</p>]]></description>
			<author><![CDATA[dummy@example.com (Maisondouf)]]></author>
			<pubDate>Thu, 31 Jan 2013 23:10:25 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12418201#p12418201</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12406081#p12406081</link>
			<description><![CDATA[<p>@Maisondouf #6 :<br /><strong>IFS</strong> est une variable utiisée par le shell, au même titre que <strong>PATH</strong>. Voici un extrait de <strong>man bash</strong> :</p><div class="quotebox"><blockquote><div><p>IFS&#160; &#160; The Internal Field Separator that is&#160; used&#160; for&#160; word&#160; splitting<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; after&#160; expansion&#160; and&#160; to&#160; split&#160; lines into words with the read<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; builtin&#160; command.&#160; &#160;The&#160; default&#160; value&#160; is&#160; ``&lt;space&gt;&lt;tab&gt;&lt;new‐<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; line&gt;&#039;&#039;.</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Thu, 31 Jan 2013 05:24:16 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12406081#p12406081</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12405191#p12405191</link>
			<description><![CDATA[<p>Trop fort, pingouinux....<br />Mais c&#039;est quoi cet IFS, une variable globale d&#039;environnement comme $PATH ou autre chose de spécial ?</p>]]></description>
			<author><![CDATA[dummy@example.com (Maisondouf)]]></author>
			<pubDate>Thu, 31 Jan 2013 00:55:29 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12405191#p12405191</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12393151#p12393151</link>
			<description><![CDATA[<p>Bonjour,<br />Pour compléter ce qui a été dit, dans l&#039;exemple du #1, avec <strong>IFS=:</strong>, c&#039;est <strong>var1</strong> qui contient la ligne complète.</p><div class="codebox"><pre><code>$ while IFS=&#039; &#039; read var1 var2 var3; do echo &quot;=$var1=$var2=$var3=&quot;; done &lt;ligne.txt
=aaa=bbb=ccc=
=ddd=eee=fff=
=ggg=hhh=iii=</code></pre></div><div class="codebox"><pre><code>$ while IFS=: read var1 var2 var3; do echo &quot;=$var1=$var2=$var3=&quot;; done &lt;ligne.txt
=aaa bbb ccc===
=ddd eee fff===
=ggg hhh iii===</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Wed, 30 Jan 2013 04:39:01 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12393151#p12393151</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12392281#p12392281</link>
			<description><![CDATA[<p>Si tu mets ça dans ton fichier de test:</p><div class="codebox"><pre><code>aaa:bbb ccc qqq
ddd eee fff
ggg hhh iii</code></pre></div><p>La boucle suivante ne va pas réagir de la même manière avec IFS=&#039;&#160; &#039;&#160; et IFS=&#039;:&#039;</p><div class="codebox"><pre><code>for i in `echo $(cat ligne.txt)`; do echo $i ;done</code></pre></div><p>Avec l&#039;espace (export IFS=\ ), ça donne:</p><div class="codebox"><pre><code>aaa:bbb
ccc
qqq
ddd
eee
fff
ggg
hhh
iii</code></pre></div><p>avec &#039;:&#039; (export IFS=:), ça donne ça:</p><div class="codebox"><pre><code>aaa bbb ccc qqq
ddd eee fff
ggg hhh iii</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Maisondouf)]]></author>
			<pubDate>Tue, 29 Jan 2013 23:34:33 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12392281#p12392281</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12392271#p12392271</link>
			<description><![CDATA[<div class="codebox"><pre><code>$ cat fichier 
cat:cot:cut
$ oIFS=&quot;$IFS&quot;; IFS=&#039;:&#039;; echo $(cat fichier ); IFS=&quot;$oIFS&quot;
cat cot cut</code></pre></div><p>Je ne suis pas sûr d&#039;avoir compris ce que tu espérais obtenir.</p>]]></description>
			<author><![CDATA[dummy@example.com (Watael)]]></author>
			<pubDate>Tue, 29 Jan 2013 23:34:01 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12392271#p12392271</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12392061#p12392061</link>
			<description><![CDATA[<p>ça va marcher mieux avec:</p><div class="codebox"><pre><code>export ISF=:</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Maisondouf)]]></author>
			<pubDate>Tue, 29 Jan 2013 23:23:07 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12392061#p12392061</guid>
		</item>
		<item>
			<title><![CDATA[Symbole de l'IFS]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12391551#p12391551</link>
			<description><![CDATA[<p>Bonsoir,</p><p>Voila plusieurs fois qu&#039;en lisant des scripts, je tombe sur l&#039;IFS, le fameux séparateur de champs. Je pensais avoir bien compris comment ce dernier fonctionnait. Mais sur certains code, je ne comprends pas. Par exemple, si j&#039;ai un fichier texte de ce type :</p><p>ligne.txt :</p><div class="codebox"><pre><code>aaa bbb ccc
ddd eee fff
ggg hhh iii</code></pre></div><p>Si je fais ceci :</p><div class="codebox"><pre><code>while IFS=$&#039; &#039; read var1 var2 var3; do
echo $var1 $var2 $var3
done;</code></pre></div><p>Il va bien renvoyé sur chaque variable les valeurs voulu, var1=aaa, var2=bbb, var3=ccc puis var1=ddd,...ext. Ici, pas de problème, j&#039;ai défini que mon séparateur de champs n&#039;était autre qu&#039;un espace.</p><p>Mais...Si je fais ceci :</p><div class="codebox"><pre><code>IFS=:
echo $(cat ligne.txt)</code></pre></div><p>Il m&#039;affiche le fichier telle que je l&#039;ai présenté au départ. D&#039;où ma question, à quoi fait allusion le &#039;:&#039; ? Qu&#039;est ce que le shell comprend en lisant ce caractère ?</p><p>Merci d&#039;avance et bonne soirée.</p>]]></description>
			<author><![CDATA[dummy@example.com (Latsuj)]]></author>
			<pubDate>Tue, 29 Jan 2013 22:51:50 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12391551#p12391551</guid>
		</item>
	</channel>
</rss>
