<?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=338233&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=338233</link>
		<description><![CDATA[Les sujets les plus récents dans [résolu] Peut-on exécuter un script dans un terminal ?.]]></description>
		<lastBuildDate>Mon, 17 Aug 2009 11:56:15 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874479#p2874479</link>
			<description><![CDATA[<div class="quotebox"><cite>ArkSeth a écrit&#160;:</cite><blockquote><div><p>Pour lancer un script shell avec le shell courant, y a $0 ./script, aussi, non ? ($0 pointe sur le programme actuellement exécuté, donc quand vous tapez ça dans une console, ça vous donne l&#039;exécutable du shell courant).</p></div></blockquote></div><p>Le script ne se lance pas dans le shell courant avec ta méthode, il se lance dans un sous-shell (même si le nom du shell utilisé est le même). De plus, ça ignore l&#039;indication dans le shabang sans pour autant se comporter comme &quot;source&quot;, ce qui explique pourquoi cette méthode n&#039;est jamais utilisée... Essaie de lancer un script Perl ou Python avec <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Link31)]]></author>
			<pubDate>Mon, 17 Aug 2009 11:56:15 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874479#p2874479</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874215#p2874215</link>
			<description><![CDATA[<p>Pour lancer un script shell avec le shell courant, y a $0 ./script, aussi, non ? ($0 pointe sur le programme actuellement exécuté, donc quand vous tapez ça dans une console, ça vous donne l&#039;exécutable du shell courant).</p><p>Pour un fichier local, toujours utiliser ./fichier <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /> J&#039;ai eu le même problème en créant un fichier appelé &quot;test&quot; dans le répertoire courant, une fois, et en ayant mis &#039;.&#039; au début de mon PATH... les if test et while test dans les autres scripts marchaient moins bien <img src="http://forum.ubuntu-fr.org/img/smilies/roll.png" width="15" height="15" alt="roll" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Elzen)]]></author>
			<pubDate>Mon, 17 Aug 2009 09:07:58 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874215#p2874215</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873856#p2873856</link>
			<description><![CDATA[<div class="quotebox"><cite>Link31 a écrit&#160;:</cite><blockquote><div><p>®om : &quot;script&quot; est un utilitaire système, donc un exécutable ELF... Essaie un autre nom pour ton script.</p></div></blockquote></div><p>Arf du coup il prend le dessus quand c&#039;est &#039;.&#039;, mais pas quand c&#039;est bash… Il ne devrait jamais prendre le dessus…<br />Merci en tout cas.</p>]]></description>
			<author><![CDATA[dummy@example.com (®om)]]></author>
			<pubDate>Sun, 16 Aug 2009 23:10:08 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873856#p2873856</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873787#p2873787</link>
			<description><![CDATA[<p>®om : &quot;script&quot; est un utilitaire système, donc un exécutable ELF... Essaie un autre nom pour ton script.</p>]]></description>
			<author><![CDATA[dummy@example.com (Link31)]]></author>
			<pubDate>Sun, 16 Aug 2009 22:01:45 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873787#p2873787</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873531#p2873531</link>
			<description><![CDATA[<p>Ah ouais. Tiens bizarrement le source il plante même sur le #!/bin/sh :</p><div class="codebox"><pre><code>rom@rom-laptop:/tmp/test$ cat script
#!/bin/sh
echo $&#039;\n&#039;
rom@rom-laptop:/tmp/test$ sh script
$

rom@rom-laptop:/tmp/test$ bash script


rom@rom-laptop:/tmp/test$ . script
bash: ELF : commande introuvable</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (®om)]]></author>
			<pubDate>Sun, 16 Aug 2009 19:29:59 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873531#p2873531</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873509#p2873509</link>
			<description><![CDATA[<div class="quotebox"><cite>®om a écrit&#160;:</cite><blockquote><div><div class="quotebox"><cite>Christophe C a écrit&#160;:</cite><blockquote><div><p>Quelle différence entre <strong>xterm -e&#160; &#039;. /home/chris/Documents/test.sh;read&#039;</strong><br />et <strong>xterm -e&#160; &#039;bash /home/chris/Documents/test.sh;read&#039;</strong> ?</p></div></blockquote></div><p>Si un jour tu changes ton script en #!/bin/autre_shell_non_compatible_bash, tu n&#039;auras pas besoin de mettre à jour ton lanceur.</p><p>Mais bon peu importe <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p></div></blockquote></div><p>Non, dans les deux cas il faudrait changer le lanceur. La différence, c&#039;est que la syntaxe &#039;. /home/chris/Documents/test.sh&#039;, aussi appelé &quot;source&quot;, lance le script directement dans le shell courant, alors que &#039;bash /home/chris/Documents/test.sh&#039; lance le shell dans un sous-shell (qui sera forcément un shell bash).</p><p>Et &quot;source&quot; est incapable de lancer un binaire.</p><p>Pour lancer n&#039;importe quel exécutable, script ou binaire, en se basant sur son shabang, il faut utiliser la syntaxe : &#039;/home/chris/Documents/test.sh&#039; ou &#039;cd /home/chris/Documents; ./test.sh&#039;.</p>]]></description>
			<author><![CDATA[dummy@example.com (Link31)]]></author>
			<pubDate>Sun, 16 Aug 2009 19:22:39 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873509#p2873509</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873432#p2873432</link>
			<description><![CDATA[<div class="quotebox"><cite>Christophe C a écrit&#160;:</cite><blockquote><div><p>Ah bon ? Le point permet de lancer ts les scripts ?</p></div></blockquote></div><p>Oui, ça permet même de lancer les programme (genre code C compilé) : ./programme.<br />Dans tous les cas, il regarde le debut du fichier pour voir ce que c&#039;est ; si c&#039;est un script, il regarde avec quel shell on lui a demandé de le lancé et il le lance.</p>]]></description>
			<author><![CDATA[dummy@example.com (chaoswizard)]]></author>
			<pubDate>Sun, 16 Aug 2009 18:47:45 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873432#p2873432</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873425#p2873425</link>
			<description><![CDATA[<p>Ah bon ? Le point permet de lancer ts les scripts ?</p>]]></description>
			<author><![CDATA[dummy@example.com (Christophe C)]]></author>
			<pubDate>Sun, 16 Aug 2009 18:44:16 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2873425#p2873425</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872524#p2872524</link>
			<description><![CDATA[<div class="quotebox"><cite>Christophe C a écrit&#160;:</cite><blockquote><div><p>Quelle différence entre <strong>xterm -e&#160; &#039;. /home/chris/Documents/test.sh;read&#039;</strong><br />et <strong>xterm -e&#160; &#039;bash /home/chris/Documents/test.sh;read&#039;</strong> ?</p></div></blockquote></div><p>Si un jour tu changes ton script en #!/bin/autre_shell_non_compatible_bash, tu n&#039;auras pas besoin de mettre à jour ton lanceur.</p><p>Mais bon peu importe <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (®om)]]></author>
			<pubDate>Sun, 16 Aug 2009 11:32:11 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872524#p2872524</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872519#p2872519</link>
			<description><![CDATA[<p>Quelle différence entre <strong>xterm -e&#160; &#039;. /home/chris/Documents/test.sh;read&#039;</strong><br />et <strong>xterm -e&#160; &#039;bash /home/chris/Documents/test.sh;read&#039;</strong> ?</p><p>Je précise que j&#039;ai testé <strong>xterm -e&#160; &#039;bash /home/chris/Documents/test.sh;read&#039;</strong>, ave un en-tête<strong> #!/bin/bash</strong>, et ça marche très bien.</p><p>Cordialement.</p>]]></description>
			<author><![CDATA[dummy@example.com (Christophe C)]]></author>
			<pubDate>Sun, 16 Aug 2009 11:28:28 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872519#p2872519</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872411#p2872411</link>
			<description><![CDATA[<div class="codebox"><pre><code>xterm -e  &#039;. /home/chris/Documents/test.sh;read</code></pre></div><p>(comme ça ça choisit le bon shell que tu as indiqué au début)</p>]]></description>
			<author><![CDATA[dummy@example.com (®om)]]></author>
			<pubDate>Sun, 16 Aug 2009 10:38:13 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872411#p2872411</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872407#p2872407</link>
			<description><![CDATA[<p>Ah, cool.</p><p>Chez&#160; moi, ça donne <strong>xterm -e&#160; &#039;bash /home/chris/Documents/test.sh;read&#039;</strong>, ou<br />* xterme -e ouvre le terminal<br />* bash lance le script, <br />* read empèche la fermeture du terminal à la fin, ce qui me permet de voir ce qui s&#039;est passé.</p><p>Excellent ! Et merci beaucoup <img src="http://forum.ubuntu-fr.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" />!</p>]]></description>
			<author><![CDATA[dummy@example.com (Christophe C)]]></author>
			<pubDate>Sun, 16 Aug 2009 10:36:03 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872407#p2872407</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872392#p2872392</link>
			<description><![CDATA[<p>Ah d&#039;accord, je comprends mieux <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Avec gnome-terminal c&#039;est un peu buggé à ce niveau-là, mais avec xterm c&#039;est mieux :</p><div class="codebox"><pre><code>xterm -e &#039;echo salut;read&#039;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (®om)]]></author>
			<pubDate>Sun, 16 Aug 2009 10:30:21 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872392#p2872392</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872376#p2872376</link>
			<description><![CDATA[<div class="codebox"><pre><code>C&#039;est un peu le même genre de question que &quot;peut-on écrire du texte dans un traitement de texte?&quot; lol</code></pre></div><p>Sans doute. Donc tu m&#039;explique comment ont fait ?</p><p>Je ne parle évidement pas de lancer le script depuis un terminal par un <strong>bash script</strong>. Ca je sais faire. Je n&#039;essaie pas de lancer un script DEPUIS un terminal, mais DANS un terminal.</p><p>Je souhaite :<br />- créer un lanceur<br />- cliquer sur le lanceur<br />- il ouvre le terminal et éxécute dedans le script. Je peut alors voir tous les messages relatif à l&#039;éxecution du script.</p><p>Cordialement.</p>]]></description>
			<author><![CDATA[dummy@example.com (Christophe C)]]></author>
			<pubDate>Sun, 16 Aug 2009 10:23:27 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872376#p2872376</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [résolu] Peut-on exécuter un script dans un terminal ?]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872226#p2872226</link>
			<description><![CDATA[<div class="quotebox"><cite>Christophe C a écrit&#160;:</cite><blockquote><div><p>Peut-on exécuter un script dans un terminal ?</p></div></blockquote></div><p>Le contraire serait embêtant.</p><p>C&#039;est un peu le même genre de question que &quot;peut-on écrire du texte dans un traitement de texte?&quot; <img src="http://forum.ubuntu-fr.org/img/smilies/lol.png" width="15" height="15" alt="lol" /></p>]]></description>
			<author><![CDATA[dummy@example.com (®om)]]></author>
			<pubDate>Sun, 16 Aug 2009 09:19:50 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2872226#p2872226</guid>
		</item>
	</channel>
</rss>
