<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet: sed</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>Finding ethernet address (MAC) of an IP address with arping</title>
        <link>http://www.posteet.com/view/430</link>
        <description>
        <![CDATA[<pre>arping -c 1 192.168.1.1 | grep &quot;:&quot; | sed &quot;s/\[//g;s/\]//g&quot; |gawk '{print $5}'
# 00:AA:BB:CC:DD:EE

# Find MACs of all the hosts on a specific network with broadcast pings. Displays:
# 192.168.1.1 -&gt; 00:AA:BB:CC:DD:EE
# 192.168.1.2 -&gt; 00:FC:AE:5C:D1:A6
# ...
for i in `ping -b -c 5 192.168.1.255 | grep &quot;: ic&quot; | gawk '{print $4}' | sort -u | sed &quot;s/://g&quot;`
do 
   arping -c 1 $i | grep &quot;:&quot; | sed &quot;s/\[//g;s/\]//g&quot; | gawk '{a=$4&quot; -&gt; &quot;$5;print a}'
done</pre> <a href="http://www.posteet.com/tags/arping">[arping]</a>  <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/ethernet">[ethernet]</a>  <a href="http://www.posteet.com/tags/gawk">[gawk]</a>  <a href="http://www.posteet.com/tags/grep">[grep]</a>  <a href="http://www.posteet.com/tags/mac">[mac]</a>  <a href="http://www.posteet.com/tags/sed">[sed]</a>  <a href="http://www.posteet.com/tags/shell">[shell]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Wed, 14 Nov 2007 14:01:07 +0000</pubDate>

            <category>arping</category>
            <category>bash</category>
            <category>ethernet</category>
            <category>gawk</category>
            <category>grep</category>
            <category>mac</category>
            <category>sed</category>
            <category>shell</category>
    
    </item>

  
    <item>
        <title>Remplacer les CRLF par des LF</title>
        <link>http://www.posteet.com/view/242</link>
        <description>
        <![CDATA[<pre># Permet de remplacer les CRLF de fin de lignes par des LF dans l'ensemble des fichiers listés par le find
# NB : on crée obligatoirement un nouveau fichier avant de remplacer l'original, sinon on risque de se retrouver avec un fichier vide

for i in `find . -name '*.sh' -print`;do echo &quot;Traitement de $i...&quot;;sed 's/\x0D$//' $i &gt; $i.CRLFtoLF;mv -f $i.CRLFtoLF $i;done

# Ne pas omettre de rendre a nouveau executable les scripts Shell
for i in `find . -name '*.sh' -print`;do echo &quot;Traitement de $i...&quot;; chmod +x $i;done</pre> <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/crlf">[crlf]</a>  <a href="http://www.posteet.com/tags/lf">[lf]</a>  <a href="http://www.posteet.com/tags/linux">[linux]</a>  <a href="http://www.posteet.com/tags/sed">[sed]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Tue, 06 Nov 2007 08:51:42 +0000</pubDate>

            <category>bash</category>
            <category>crlf</category>
            <category>lf</category>
            <category>linux</category>
            <category>sed</category>
    
    </item>

  
    <item>
        <title>Rappels de commandes Bash</title>
        <link>http://www.posteet.com/view/238</link>
        <description>
        <![CDATA[<pre>### Gravure et image iso ###
# creer une image iso avec le support des noms longs :
mkisofs -joliet-long -R -o image.iso /mon/repertoire/a/graver/
# puis la graver sur DVD
growisofs -Z /dev/dvdrom=image.iso 

### Utilisation basique de sed ###
# Ne pas oublier de rediriger la sortie vers &quot;fichier2&quot;
# Sinon aucune modifications se sera effectuées :
## Rechercher / Remplacer une expression dans un fichier ##
sed -e &quot;s/exp1/exp2/&quot; fichier
## Rechercher / Traiter les lignes qui contiennent l'expression ##
# Imprime uniquement les lignes comprenant l'expression :
sed -ne &quot;/expression/p&quot; fichier
# Supprime les lignes contenant l'expression
sed -e &quot;/expression/d&quot; fichier</pre> <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/gravure">[gravure]</a>  <a href="http://www.posteet.com/tags/sed">[sed]</a> ]]>        </description>
        <dc:creator>neorom</dc:creator>
        <pubDate>Tue, 06 Nov 2007 08:10:23 +0000</pubDate>

            <category>bash</category>
            <category>gravure</category>
            <category>sed</category>
    
    </item>


</channel>
</rss>
