<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://mirmodynamics.com/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Mirmo Dynamics - Tag - bash</title>
  <link>http://mirmodynamics.com/</link>
  <atom:link href="http://mirmodynamics.com/feed/tag/bash/rss2" rel="self" type="application/rss+xml"/>
  <description>Si tu kiffes pas reunoi, t'écoutes pas et puis c'est tout.</description>
  <language>en</language>
  <pubDate>Sun, 14 Mar 2010 19:59:01 +0100</pubDate>
  <copyright>2003-2009 &amp;copy; Geoffrey Bachelet</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Mass vim file opening reloaded</title>
    <link>http://mirmodynamics.com/post/2008/10/16/Mass-vim-file-opening-reloaded</link>
    <guid isPermaLink="false">urn:md5:043b3c3596084fc127d581eb3ee0bb15</guid>
    <pubDate>Thu, 16 Oct 2008 21:20:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>bash</category><category>grep</category><category>handy</category><category>script</category><category>tips</category><category>vim</category>    
    <description>    &lt;p&gt;Thinking about it, &lt;a href=&quot;http://mirmodynamics.com/post/2008/10/14/Mass-vim-file-opening&quot;&gt;the snippet I posted earlier&lt;/a&gt; was a bit silly as vim can open by itself multiple files way more efficiently. The only benefit from my script is that I don't have to type the &lt;code&gt;--servername&lt;/code&gt; and &lt;code&gt;--remote-silent-tab&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;So let's add some usefulness ! First, when I need this script, it's often that I first grepped the files, and then decide that I want to edit them all. From this point of view, having to pass them as &lt;em&gt;arguments&lt;/em&gt; is not that handy, so we'll add a way to pass them via &lt;code&gt;STDIN&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Also, what if I want to send them to another vim server ? We'll add this ability too.&lt;/p&gt;


&lt;p&gt;Here is the resulting script:&lt;/p&gt;

&lt;pre&gt;
#!/usr/bin/env bash

# set a default SERVERNAME
SERVERNAME=&amp;quot;ash0&amp;quot;

# look for files on stdin
if ! [ -t 0 ]; then
  FILES=`cat /dev/stdin`
else
  exit;
fi;

# now let's check if we want a specific vim server
if ! [ -z $1 ]; then
  SERVERNAME=$1
fi;

# we can now open the files
/usr/bin/gvim --servername $SERVERNAME --remote-silent-tab $FILES
&lt;/pre&gt;


&lt;p&gt;Tada !&lt;/p&gt;


&lt;p&gt;You can now do the followings:&lt;/p&gt;

&lt;pre&gt;
grep foo | sendtovim
grep foo | sendtovim grep0
&lt;/pre&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/10/16/Mass-vim-file-opening-reloaded#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/10/16/Mass-vim-file-opening-reloaded#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1144</wfw:commentRss>
      </item>
    
  <item>
    <title>Rename directories to lowercase</title>
    <link>http://mirmodynamics.com/post/2008/07/10/Rename-directories-to-lowercase</link>
    <guid isPermaLink="false">urn:md5:2cd7b053554f36efc38f1eedf42f7089</guid>
    <pubDate>Thu, 10 Jul 2008 15:35:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>bash</category><category>handy</category><category>lowercase</category><category>shell</category><category>useless</category>    
    <description>    &lt;p&gt;Using a single (and somewhat simple) shell line, you can rename any directory to its lowercase version.&lt;/p&gt;

&lt;pre&gt;
for i in *; do lcase=`echo $i | tr A-Z a-z`; if [ ! -d $lcase ]; then mv $i $lcase; fi; done;
&lt;/pre&gt;


&lt;p&gt;Viva el chell !&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/07/10/Rename-directories-to-lowercase#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/07/10/Rename-directories-to-lowercase#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1111</wfw:commentRss>
      </item>
    
</channel>
</rss>