<?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=363999&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=363999</link>
		<description><![CDATA[Les sujets les plus récents dans [RESOLU] Aide traitement en arrière-plan en BASH.]]></description>
		<lastBuildDate>Wed, 09 Dec 2009 17:19:43 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3128060#p3128060</link>
			<description><![CDATA[<p>Si tu veut faire propre :</p><div class="codebox"><pre><code>#!/bin/bash

clear

select item in &quot;Modifier le fichier&quot; &quot;Lancer le programme&quot; &quot;Arreter le programme&quot;; do
    case $item in
        Modifier*)
            sudo gedit /var/etc/CCcam.cfg
            break
            ;;
        Lancer*)
            sudo /var/bin/./CCcam -d
            break
            ;;
        Arreter*)
            sudo killall /var/bin/CCcam
            break
            ;;
        *)
            echo &gt;&amp;2 &quot;Mauvais choix !&quot;
            ;;
    esac
done</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (sputnick)]]></author>
			<pubDate>Wed, 09 Dec 2009 17:19:43 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3128060#p3128060</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121565#p3121565</link>
			<description><![CDATA[<p>justement j&#039;ai vérifié avant de poster, j&#039;ai fait précisément la même commande que toi</p><div class="codebox"><pre><code>for (( i=1 ; i&lt;20 ; i++ )); do beep ; sleep1 ; done &amp;</code></pre></div><p>puis j&#039;ai quitté le terminal ([ctrl]+[d]) et j&#039;ai bien entendu mes bips jusqu&#039;au bout</p><p>ce que je voulais dire par &quot;graphique&quot; c&#039;est que (de ce que j&#039;ai compris) la commande nohup permet de ne pas rendre dépendant un process d&#039;un utilisateur, donc je suppose que si je me déconnectais de toutes mes sessions, mon programme se terminerait alors.</p><p>Qu&#039;en penses-tu?</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Sun, 06 Dec 2009 21:23:53 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121565#p3121565</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121511#p3121511</link>
			<description><![CDATA[<div class="quotebox"><cite>nesthib a écrit&#160;:</cite><blockquote><div><p>corrige moi si je me trompe, mais nohup ne sert-il pas à rien tant que tu es connecté à ta session graphique?<br />chez-moi un simple <strong>&amp;</strong> suffit à lancer une commande qui résiste à la fermeture du terminal</p></div></blockquote></div><p>Pas forcément, pour te convaincre, voici un petit script :</p><div class="codebox"><pre><code>#!/bin/bash
for((a=0;a&lt;1000;a++))
do
sleep 1
done</code></pre></div><p>On est ok que son exécution devrait durer 1000 secondes. Ce qui nous laisse largement le temps de vérifier son existence dans la table des processus... <br />Appelons-le sleep1000.sh et rendons-le exécutable. </p><p>Ouvre 2 xterm (ou équivalent). Dans l&#039;un exécute le script <strong>./sleep1000.sh &amp;</strong> et dans l&#039;autre lance la commande <strong>ps -fC sleep1000.sh</strong><br />En toute logique, le processus apparaît. Ferme le xterm dans lequel il s&#039;exécute puis vérifie à nouveau son existance...<br />Ben il a disparu ...</p><p>Tu me diras...ah ouais mais ce n&#039;est pas une application graphique :<br />autre exemple :</p><div class="codebox"><pre><code>mplayer &lt;uneVideo&gt; &lt;/dev/null &gt;&amp;/dev/null &amp;</code></pre></div><p>Dans ce cas, <strong>nohup</strong> n&#039;a aucun effet (et je ne sais pas pourquoi même si je pense que cela est dû au redirections) : si tu fermes ton term, mplayer se ferme. Cependant, <strong>disown -h %+</strong> permet de fermer le term tout en concervant mplayer.</p>]]></description>
			<author><![CDATA[dummy@example.com (Totor)]]></author>
			<pubDate>Sun, 06 Dec 2009 21:03:26 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121511#p3121511</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121335#p3121335</link>
			<description><![CDATA[<p>voilà ça marche maintenant <img src="http://forum.ubuntu-fr.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /> Merci bcp</p><div class="codebox"><pre><code>su 
/var/bin/./CCcam -d &amp;
exit</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Rido)]]></author>
			<pubDate>Sun, 06 Dec 2009 19:58:57 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121335#p3121335</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121101#p3121101</link>
			<description><![CDATA[<p>@Totor</p><div class="quotebox"><cite>Totor a écrit&#160;:</cite><blockquote><div><p>ça ne suffit pas :</p><div class="codebox"><pre><code>nohup ta_commande &amp;</code></pre></div><p>ou </p><div class="codebox"><pre><code>ta_commande &amp;
disown -h %+</code></pre></div></div></blockquote></div><p>corrige moi si je me trompe, mais nohup ne sert-il pas à rien tant que tu es connecté à ta session graphique?<br />chez-moi un simple <strong>&amp;</strong> suffit à lancer une commande qui résiste à la fermeture du terminal</p><p>@Rido</p><div class="quotebox"><cite>Rido a écrit&#160;:</cite><blockquote><div><p>comment je doit faire pour l&#039;insérer dans mon fichier car je dois lancer le script depuis putty</p></div></blockquote></div><p>modifie juste la commande dans ton fichier de script</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Sun, 06 Dec 2009 18:38:38 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121101#p3121101</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121005#p3121005</link>
			<description><![CDATA[<p>merci pour votre repense<br />je vien de teste&#160; sur un terminal <br />ta_commande &amp;<br />suivi de Ctrl+D<br />et ça marche <img src="http://forum.ubuntu-fr.org/img/smilies/lol.png" width="15" height="15" alt="lol" /><br />comment je doit faire pour l&#039;inséré<br />dans mon fichier </p><div class="codebox"><pre><code>sudo /var/bin/./CCcam -d &amp;</code></pre></div><p>car je doi lancer le script depuis putty <img src="http://forum.ubuntu-fr.org/img/smilies/roll.png" width="15" height="15" alt="roll" /></p><p>Merci encord pour votre aide</p>]]></description>
			<author><![CDATA[dummy@example.com (Rido)]]></author>
			<pubDate>Sun, 06 Dec 2009 17:52:20 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3121005#p3121005</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120826#p3120826</link>
			<description><![CDATA[<div class="quotebox"><cite>nesthib a écrit&#160;:</cite><blockquote><div><p>rajoute un &amp; à la fin de la ligne</p><div class="codebox"><pre><code>ta_commande &amp;</code></pre></div></div></blockquote></div><p>ça ne suffit pas :</p><div class="codebox"><pre><code>nohup ta_commande &amp;</code></pre></div><p>ou </p><div class="codebox"><pre><code>ta_commande &amp;
disown -h %+</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Totor)]]></author>
			<pubDate>Sun, 06 Dec 2009 17:09:27 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120826#p3120826</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120745#p3120745</link>
			<description><![CDATA[<p><em>(et ferme ta console avec Ctrl+D ou exit, pas avec la X)</em></p>]]></description>
			<author><![CDATA[dummy@example.com (®om)]]></author>
			<pubDate>Sun, 06 Dec 2009 16:42:57 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120745#p3120745</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120739#p3120739</link>
			<description><![CDATA[<p>rajoute un &amp; à la fin de la ligne</p><div class="codebox"><pre><code>ta_commande &amp;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Sun, 06 Dec 2009 16:41:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120739#p3120739</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLU] Aide traitement en arrière-plan en BASH]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120425#p3120425</link>
			<description><![CDATA[<p>bonjour voilà j ai fais un bash pour me faciliter la tache</p><div class="codebox"><pre><code>#!/bin/sh
clear
echo

echo &quot;====&gt; 1. Modifier le fichier&quot;
echo &quot;====&gt; 2. Lancer le programme&quot;
echo &quot;====&gt; 3. Arreter le programme&quot;
echo
echo

echo -n &quot;Faite votre choix ? &quot;
read repense
echo

if [ &quot;$repense&quot; = &quot;1&quot; ]
then
	sudo gedit /var/etc/CCcam.cfg
fi

if [ &quot;$repense&quot; = &quot;2&quot; ]
then
       sudo /var/bin/./CCcam -d

fi

if [ &quot;$repense&quot; = &quot;3&quot; ]
then
	sudo killall /var/bin/CCcam
fi</code></pre></div><p>quand je lance ça </p><div class="codebox"><pre><code>sudo /var/bin/./CCcam -d</code></pre></div><p>si je ferme la console le programme s&#039;arrête</p><p>aidé moi svp <br />Merci</p>]]></description>
			<author><![CDATA[dummy@example.com (Rido)]]></author>
			<pubDate>Sun, 06 Dec 2009 14:30:54 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3120425#p3120425</guid>
		</item>
	</channel>
</rss>
