<?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=338467&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / rendre un script executable depuis n'importe ou [resolu]]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=338467</link>
		<description><![CDATA[Les sujets les plus récents dans rendre un script executable depuis n'importe ou [resolu].]]></description>
		<lastBuildDate>Mon, 17 Aug 2009 18:43:28 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  rendre un script executable depuis n'importe ou [resolu]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2875223#p2875223</link>
			<description><![CDATA[<div class="quotebox"><cite>iuchiban a écrit&#160;:</cite><blockquote><div><p>Oula, ca se sont des scripts de windowsiens car tu peux remplacer ls par dir avec un alias par exemple :</p><div class="codebox"><pre><code>alias dir=&#039;ls -l&#039;</code></pre></div></div></blockquote></div><p>Même pas besoin, &quot;dir&quot; est déjà une commande... <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Link31)]]></author>
			<pubDate>Mon, 17 Aug 2009 18:43:28 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2875223#p2875223</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  rendre un script executable depuis n'importe ou [resolu]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874670#p2874670</link>
			<description><![CDATA[<p>Merci</p>]]></description>
			<author><![CDATA[dummy@example.com (sdblepas)]]></author>
			<pubDate>Mon, 17 Aug 2009 13:36:50 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874670#p2874670</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  rendre un script executable depuis n'importe ou [resolu]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874660#p2874660</link>
			<description><![CDATA[<p>Oula, ca se sont des scripts de windowsiens car tu peux remplacer ls par dir avec un alias par exemple :</p><div class="codebox"><pre><code>alias dir=&#039;ls -l&#039;</code></pre></div><p>Et ton showfile, bah le owner tu l&#039;as en faisant</p><div class="codebox"><pre><code>ls -l</code></pre></div><p>et ensuite nombre de lignes / caractères :</p><div class="codebox"><pre><code>wc -l &lt;Fichier&gt;
wc -c &lt;Fichier&gt;</code></pre></div><p>Sinon, si tu as un script que tu veux pouvoir utiliser de partout :<br />- soit tu crées un alias qui lance le script<br />- soit tu rajoutes un lien symbolique dans /usr/bin<br />- soit tu modifies ton PATH pour ajouter le chemin où se trouve ton script.</p>]]></description>
			<author><![CDATA[dummy@example.com (iuchiban)]]></author>
			<pubDate>Mon, 17 Aug 2009 13:33:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874660#p2874660</guid>
		</item>
		<item>
			<title><![CDATA[rendre un script executable depuis n'importe ou [resolu]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874615#p2874615</link>
			<description><![CDATA[<p>Salut j&#039;ai tourver deux script sur le net (que je vous conseille)<br />Le premier permet d&#039;utiliser dir au lieu de ls<br />:<br />#!/bin/sh<br />#&#160; DIR - pretend we&#039;re the DIR command in DOS and display the contents<br />#&#160; &#160; of the specified file, accepting some of the standard DIR flags</p><p>usage()<br />{<br />cat &lt;&lt; EOF &gt;&amp;2<br />&#160; Usage: $0 [DOS flags] directory or directories<br />&#160; Where:<br />&#160; &#160;/D&#160; &#160; &#160; &#160; &#160; &#160;sort by columns<br />&#160; &#160;/H&#160; &#160; &#160; &#160; &#160; &#160;show help for this shell script<br />&#160; &#160;/N&#160; &#160; &#160; &#160; &#160; &#160;show long listing format with filenames on right<br />&#160; &#160;/OD&#160; &#160; &#160; &#160; &#160; sort by oldest to newest<br />&#160; &#160;/O-D&#160; &#160; &#160; &#160; &#160;sort by newest to oldest<br />&#160; &#160;/P&#160; &#160; &#160; &#160; &#160; &#160;pause after each screenful of information<br />&#160; &#160;/Q&#160; &#160; &#160; &#160; &#160; &#160;show owner of the file<br />&#160; &#160;/S&#160; &#160; &#160; &#160; &#160; &#160;recursive listing<br />&#160; &#160;/W&#160; &#160; &#160; &#160; &#160; &#160;use wide listing format<br />EOF<br />&#160; exit 0<br />}</p><p>postcmd=&quot;&quot;<br />flags=&quot;&quot;</p><p>while [ $# -gt 0 ]<br />do<br />&#160; case $1 in<br />&#160; &#160; /D&#160; &#160; &#160;) flags=&quot;$flags -x&quot;&#160; &#160; &#160; &#160; &#160; ;;<br />&#160; &#160; /H&#160; &#160; &#160;) usage&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; ;;<br />&#160; &#160; /[NQW] ) flags=&quot;$flags -l&quot;&#160; &#160; &#160; &#160; &#160; ;;<br />&#160; &#160; /OD&#160; &#160; ) flags=&quot;$flags -rt&quot;&#160; &#160; &#160; &#160; &#160;;;<br />&#160; &#160; /O-D&#160; &#160;) flags=&quot;$flags -t&quot;&#160; &#160; &#160; &#160; &#160; ;;<br />&#160; &#160; /P&#160; &#160; &#160;) postcmd=&quot;more&quot;&#160; &#160; &#160; &#160; &#160; &#160; &#160;;;<br />&#160; &#160; /S&#160; &#160; &#160;) flags=&quot;$flags -s&quot;&#160; &#160; &#160; &#160; &#160; ;;<br />&#160; &#160; &#160; &#160; &#160;* ) # unknown flag: probably a dir specifier<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; break;&#160; # so let&#039;s get outta the while loop<br />&#160; esac<br />&#160; shift&#160; &#160; &#160; &#160;# processed flag, let&#039;s see if there&#039;s another<br />done</p><p># done processing flags, now the command itself:</p><p>if [ ! -z &quot;$postcmd&quot; ] ; then<br />&#160; ls $flags &quot;$@&quot; | $postcmd<br />else<br />&#160; ls $flags &quot;$@&quot;<br />fi<br />exit0 </p><p>le deuxieme showfile il montre un fichier a l&#039; ecren<br />#!/bin/sh<br /># showfile - show the contents of a file, including additional useful info</p><p>width=72</p><p>for input<br />do<br />&#160; lines=&quot;$(wc -l &lt; $input | sed &#039;s/ //g&#039;)&quot;<br />&#160; chars=&quot;$(wc -c &lt; $input | sed &#039;s/ //g&#039;)&quot;<br />&#160; owner=&quot;$(ls -ld $input | awk &#039;{print $3}&#039;)&quot;<br />&#160; echo &quot;-----------------------------------------------------------------&quot;<br />&#160; echo &quot;File $input ($lines lines, $chars characters, owned by $owner):&quot;<br />&#160; echo &quot;-----------------------------------------------------------------&quot;<br />&#160; while read line<br />&#160; &#160; do<br />&#160; &#160; &#160; if [ ${#line} -gt $width ] ; then<br />&#160; &#160; &#160; &#160; echo &quot;$line&quot; | fmt | sed -e &#039;1s/^/&#160; /&#039; -e &#039;2,$s/^/+ /&#039;<br />&#160; &#160; &#160; else<br />&#160; &#160; &#160; &#160; echo &quot;&#160; $line&quot;<br />&#160; &#160; &#160; fi<br />&#160; &#160; done &lt; $input</p><p>&#160; echo &quot;-----------------------------------------------------------------&quot;</p><p>done | more</p><p>exit 0</p><p>Ma question est la suivante<br />dir est executable depuis n&#039;importe ou dans mon terminal mais showfile ne marche que dans le fichier ou ll est range.<br />que faudrait il que j&#039;y rajoute pour qu&#039;il marche depuis n&#039;importe ou<br />Merci</p>]]></description>
			<author><![CDATA[dummy@example.com (sdblepas)]]></author>
			<pubDate>Mon, 17 Aug 2009 13:16:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2874615#p2874615</guid>
		</item>
	</channel>
</rss>
