<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Loogaroo : Lamp / web 2.0 / Ajax ... &#187; script</title>
	<atom:link href="http://loogaroo.net/category/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://loogaroo.net</link>
	<description></description>
	<lastBuildDate>Tue, 14 Jul 2009 17:48:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Astuces pour les scripts Shell</title>
		<link>http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/</link>
		<comments>http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 17:19:53 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[ligne de commande]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/</guid>
		<description><![CDATA[Vous êtes peut être comme moi, vous utilisez PHP pour faire des scripts shell. J&#8217;utilise une petite astuce pour mettre en place des variables dans mes scripts en reprennant la syntaxe qu&#8217;on utilise sous linux avec &#8220;&#8211;var value&#8221;
un petit include que vous pouvez transformez en fonction comme bon vous semble.
for&#40;$i=1;$i&#60;sizeof&#40;$argv&#41;;$i++&#41;
&#123;
&#160;if &#40;substr&#40;$argv&#91;$i&#93;,0,2&#41;==&#34;--&#34;&#41;
&#160;&#123;
&#160;&#160; &#160;&#160; &#160;$_REQUEST&#91;substr&#40;$argv&#91;$i&#93;,2&#41;&#93;=$argv&#91;$i+1&#93;;
&#160;&#160; &#160;&#160; &#160;$i++;
&#160;&#125;
&#125;
&#160;
extract&#40;$_REQUEST&#41;;
&#160;
Comme [...]]]></description>
			<content:encoded><![CDATA[<p>Vous êtes peut être comme moi, vous utilisez PHP pour faire des scripts shell. J&#8217;utilise une petite astuce pour mettre en place des variables dans mes scripts en reprennant la syntaxe qu&#8217;on utilise sous linux avec &#8220;<strong><em>&#8211;var value</em></strong>&#8221;</p>
<p>un petit include que vous pouvez transformez en fonction comme bon vous semble.</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span>=<span style="color: #cc66cc;">1</span>;<span style="color: #0000ff;">$i</span>&lt;sizeof<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #0000ff;">$i</span>++<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>==<span style="color: #ff0000;">&quot;--&quot;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #cc66cc;">+1</span><span style="color: #66cc66;">&#93;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">$i</span>++;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/extract"><span style="color: #000066;">extract</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Comme ca quand je lance "<strong><em>mon_script.php --code TE --mode debug</em></strong>"</p>
<p>c'est comme si je faisais :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$code</span>=<span style="color: #ff0000;">&quot;TE&quot;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$mode</span>=<span style="color: #ff0000;">&quot;debug&quot;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Ca n'interessera peut être pas tout le monde mais c'est bien pratique !</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;name=Astuces%20pour%20les%20scripts%20Shell" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;bm_description=Astuces%20pour%20les%20scripts%20Shell&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
