<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Misc on Miek Gieben</title>
    <link>https://miek.nl/tags/misc/</link>
    <description>Recent content in Misc on Miek Gieben</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>© Copyright 2007-2024 Miek Gieben</copyright>
    <lastBuildDate>Thu, 27 Sep 2012 19:44:00 +0000</lastBuildDate>
    <atom:link href="https://miek.nl/tags/misc/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Source Code Pro</title>
      <link>https://miek.nl/2012/september/27/source-code-pro/</link>
      <pubDate>Thu, 27 Sep 2012 19:44:00 +0000</pubDate>
      <guid>https://miek.nl/2012/september/27/source-code-pro/</guid>
      <description>&lt;p&gt;Indeed a really nice font and fully open source. Using it now at 11pt. See:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://blogs.adobe.com/typblography/2012/09/source-code-pro.html&#34;&gt;Announcement from Adobe&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://sourceforge.net/projects/sourcecodepro.adobe/files/latest/download&#34;&gt;Download link&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Sync subversion to github.com</title>
      <link>https://miek.nl/2012/june/27/sync-subversion-to-github.com/</link>
      <pubDate>Wed, 27 Jun 2012 08:26:00 +0000</pubDate>
      <guid>https://miek.nl/2012/june/27/sync-subversion-to-github.com/</guid>
      <description>&lt;p&gt;This is a post that details on how to sync a subversion repository to git repository on github.com,&#xA;and how to keep it in sync.&lt;/p&gt;&#xA;&lt;p&gt;The following sites were instrumental in getting this to work:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://stackoverflow.com/questions/796991/fork-and-synchronise-google-code-subversion-repository-into-github&#34;&gt;stackoverflow.com question on getting svn into git&lt;/a&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://matharvard.ca/posts/2011/aug/11/git-push-with-specific-ssh-key/&#34;&gt;ssh foo&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There are a number of steps to take. From a bird&amp;rsquo;s eye view:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;git svn&lt;/code&gt; to clone the &lt;code&gt;svn&lt;/code&gt; repo to a &lt;code&gt;git&lt;/code&gt; repo;&lt;/li&gt;&#xA;&lt;li&gt;Create a github &lt;code&gt;git&lt;/code&gt; repo;&lt;/li&gt;&#xA;&lt;li&gt;Add a remote origin in your local git to the remote github repo;&lt;/li&gt;&#xA;&lt;li&gt;Use some SSH foo to use a separate SSH key for pushing to github.com.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;We are working with the fictional svn repo located at &lt;code&gt;https://svn.example.net/example&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;git-svn&lt;/code&gt; is installed;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ssh&lt;/code&gt; is installed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Clone the repository&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pandoc to RFC</title>
      <link>https://miek.nl/2011/september/28/pandoc-to-rfc/</link>
      <pubDate>Wed, 28 Sep 2011 13:45:00 +0000</pubDate>
      <guid>https://miek.nl/2011/september/28/pandoc-to-rfc/</guid>
      <description>&lt;p&gt;This is an follow-up on &lt;a href=&#34;http://www.sidnlabs.nl/laatste-berichten/nieuwsdetail/article/van-pandoc-naar-rfc/&#34;&gt;this &lt;code&gt;pandoc&lt;/code&gt; item in Dutch&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When writing &lt;a href=&#34;http://www.ietf.org/rfc/rfc4641.txt&#34;&gt;RFC 4641&lt;/a&gt; we directly wrote the&#xA;XML. Needless to say is was kinda tedious even thought the XML of &lt;a href=&#34;http://xml.resource.org/&#34;&gt;xml2rfc&lt;/a&gt;&#xA;is very &amp;ldquo;light&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;Nowadays I&amp;rsquo;m a fan of the markdown syntax and especially the syntax as supported (created?)&#xA;by &lt;a href=&#34;http://johnmacfarlane.net/pandoc/&#34;&gt;Pandoc&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So for my next RFC (if ever!) I decided I wanted to use Pandoc. As &lt;code&gt;xml2rfc&lt;/code&gt; uses XML&#xA;I thought the easiest way would be to create &lt;code&gt;docbook&lt;/code&gt; XML and transform that using&#xA;XSLT.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Computer Languages</title>
      <link>https://miek.nl/2010/august/01/computer-languages/</link>
      <pubDate>Sun, 01 Aug 2010 19:17:00 +0000</pubDate>
      <guid>https://miek.nl/2010/august/01/computer-languages/</guid>
      <description>&lt;p&gt;I have done programming in (or at least looked at) the following computer&#xA;languages during my live. Of course the world is not a perfect place,&#xA;but some languages out there are just plain awful.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;BASIC - with line numbers!&#xA;At the time (I was 11) didn&amp;rsquo;t know there was something else&#xA;out there. Fun and easy language, although I never programmed&#xA;in it ever again.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Pascal -&#xA;After BASIC, there is no going back to Pascal. Only briefly&#xA;looked at it in my youth and discarded it in favor for BASIC&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Prime sieve (in Go ofcourse)</title>
      <link>https://miek.nl/2009/november/24/prime-sieve-in-go-ofcourse/</link>
      <pubDate>Tue, 24 Nov 2009 22:55:00 +0000</pubDate>
      <guid>https://miek.nl/2009/november/24/prime-sieve-in-go-ofcourse/</guid>
      <description>&lt;p&gt;After reading up on the&#xA;&lt;a href=&#34;http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes&#34;&gt;prime sieve&lt;/a&gt;, and&#xA;playing with Go for the past week I thought needed to implement this&#xA;algorithm in Go and make it parallel.&lt;/p&gt;&#xA;&lt;p&gt;I want to create a set (&lt;em&gt;n&lt;/em&gt; in &lt;em&gt;2&lt;/em&gt;..&lt;em&gt;N&lt;/em&gt;)&#xA;&lt;a href=&#34;http://golang.org/doc/go_lang_faq.html#goroutines&#34;&gt;goroutines&lt;/a&gt;.&#xA;Each of these routines will check if it can divide a number (&lt;em&gt;i&lt;/em&gt;) by&#xA;&lt;em&gt;n&lt;/em&gt; (integer division). If so the number &lt;em&gt;i&lt;/em&gt; is not prime, otherwise&#xA;it is given to the next goroutine. Communication between the goroutines&#xA;is done via channels as in&#xA;&lt;a href=&#34;https://miek.nl/2009/november/16/first_steps_with_go/index.html&#34;&gt;this example&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>More Go</title>
      <link>https://miek.nl/2009/november/23/more-go/</link>
      <pubDate>Mon, 23 Nov 2009 22:45:00 +0000</pubDate>
      <guid>https://miek.nl/2009/november/23/more-go/</guid>
      <description>&lt;p&gt;Still learning and playing with &lt;a href=&#34;http://www.golang.org&#34;&gt;Go&lt;/a&gt;, I&amp;rsquo;ve&#xA;rewritten my&#xA;&lt;a href=&#34;https://miek.nl/2009/november/18/cat_in_go/index.html&#34;&gt;cat experiment&lt;/a&gt;, to&#xA;use a &lt;code&gt;*bufio.Reader&lt;/code&gt;, which is more correct I think. I&amp;rsquo;m also slowly&#xA;wrapping my mind around the concept of&#xA;&lt;a href=&#34;http://golang.org/doc/go_spec.html#Interface_types&#34;&gt;Interfaces&lt;/a&gt;. As a&#xA;non-OO programmer (C and non-OO Perl) is starting to see why this is&#xA;useful.&lt;/p&gt;&#xA;&lt;p&gt;So today&amp;rsquo;s exercises:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Write a cat implementation in Go. See below.&lt;/li&gt;&#xA;&lt;li&gt;Write a grep implementation in Go. See below.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;cat-in-go&#34;&gt;Cat in go&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;package main&#xA;&#xA;// A implementation of cat in Go&#xA;&#xA;import (&#xA;    &amp;quot;os&amp;quot;;&#xA;    &amp;quot;fmt&amp;quot;;&#xA;    &amp;quot;bufio&amp;quot;;&#xA;    &amp;quot;flag&amp;quot;;&#xA;)&#xA;&#xA;var numberFlag = flag.Bool(&amp;quot;n&amp;quot;, false, &amp;quot;number each line&amp;quot;)&#xA;&#xA;func cat(r *bufio.Reader) bool {&#xA;    i := 1;&#xA;    for {&#xA;&#x9;    buf, e := r.ReadBytes(&#39;\n&#39;);&#xA;&#x9;    if e == os.EOF {&#xA;&#x9;&#x9;    break&#xA;&#x9;    }&#xA;&#x9;    if *numberFlag {&#xA;&#x9;&#x9;    fmt.Fprintf(os.Stdout, &amp;quot;%5d  %s&amp;quot;, i, buf);&#xA;&#x9;&#x9;    i++&#xA;&#x9;    } else {&#xA;&#x9;&#x9;    fmt.Fprintf(os.Stdout, &amp;quot;%s&amp;quot;, buf)&#xA;&#x9;    }&#xA;    }&#xA;    return true;&#xA;}&#xA;&#xA;func main() {&#xA;    flag.Parse();&#xA;    if flag.NArg() == 0 {&#xA;&#x9;    cat(bufio.NewReader(os.Stdin))&#xA;    }&#xA;    for i := 0; i &amp;lt; flag.NArg(); i++ {&#xA;&#x9;    f, e := os.Open(flag.Arg(i), os.O_RDONLY, 0);&#xA;&#x9;    if e != nil {&#xA;&#x9;&#x9;    fmt.Fprintf(os.Stderr, &amp;quot;%s: error reading from %s: %s\n&amp;quot;,&#xA;&#x9;&#x9;&#x9;    os.Args[0], flag.Arg(i), e.String());&#xA;&#x9;&#x9;    continue;&#xA;&#x9;    }&#xA;&#x9;    if !cat(bufio.NewReader(f)) {&#xA;&#x9;&#x9;    os.Exit(1)&#xA;&#x9;    }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h1 id=&#34;grep-in-go&#34;&gt;Grep in go&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;package main&#xA;&#xA;// A implementation of Unix grep in Go&#xA;// TODO(mg) better error handling&#xA;&#xA;import (&#xA;    &amp;quot;os&amp;quot;;&#xA;    &amp;quot;fmt&amp;quot;;&#xA;    &amp;quot;bufio&amp;quot;;&#xA;    &amp;quot;regexp&amp;quot;;&#xA;    &amp;quot;flag&amp;quot;;&#xA;)&#xA;&#xA;var numberFlag = flag.Bool(&amp;quot;n&amp;quot;, false, &amp;quot;number each line&amp;quot;)&#xA;var filenameFlag = flag.Bool(&amp;quot;l&amp;quot;, false, &amp;quot;print names of matching files&amp;quot;)&#xA;&#xA;func grep(r *bufio.Reader, reg string) (match bool) {&#xA;    i := 0;&#xA;    for {&#xA;&#x9;    buf, e := r.ReadBytes(&#39;\n&#39;);&#xA;&#x9;    i++;&#xA;&#x9;    if e == os.EOF {&#xA;&#x9;&#x9;    break&#xA;&#x9;    }&#xA;&#x9;    if m, _ := regexp.Match(reg, buf); m == true {&#xA;&#x9;&#x9;    match = true;&#xA;&#x9;&#x9;    if *filenameFlag {&#xA;&#x9;&#x9;&#x9;    return match&#xA;&#x9;&#x9;    }&#xA;&#x9;&#x9;    if *numberFlag {&#xA;&#x9;&#x9;&#x9;    fmt.Fprintf(os.Stdout, &amp;quot;%5.d:  %s&amp;quot;, i, buf)&#xA;&#x9;&#x9;    } else {&#xA;&#x9;&#x9;&#x9;    fmt.Fprintf(os.Stdout, &amp;quot;%s&amp;quot;, buf)&#xA;&#x9;&#x9;    }&#xA;&#x9;    }&#xA;    }&#xA;    return match;&#xA;}&#xA;&#xA;func main() {&#xA;    flag.Parse();&#xA;    if flag.NArg() &amp;lt; 1 {&#xA;&#x9;    fmt.Fprintf(os.Stderr, &amp;quot;%s: missing regexp\n&amp;quot;, os.Args[0]);&#xA;&#x9;    os.Exit(1);&#xA;    }&#xA;    if flag.NArg() == 1 {&#xA;&#x9;    if grep(bufio.NewReader(os.Stdin), flag.Arg(0)) {&#xA;&#x9;&#x9;    if *filenameFlag {&#xA;&#x9;&#x9;&#x9;    fmt.Fprintf(os.Stdout, &amp;quot;(standard input)\n&amp;quot;);&#xA;&#x9;&#x9;    }&#xA;&#x9;    }&#xA;    }&#xA;    for i := 1; i &amp;lt; flag.NArg(); i++ {&#xA;&#x9;    f, e := os.Open(flag.Arg(i), os.O_RDONLY, 0);&#xA;&#x9;    if e != nil {&#xA;&#x9;&#x9;    fmt.Fprintf(os.Stderr, &amp;quot;%s: error reading from %s: %s\n&amp;quot;,&#xA;&#x9;&#x9;&#x9;    os.Args[0], flag.Arg(i), e.String());&#xA;&#x9;&#x9;    continue;&#xA;&#x9;    }&#xA;&#x9;    if grep(bufio.NewReader(f), flag.Arg(0)) {&#xA;&#x9;&#x9;    if *filenameFlag {&#xA;&#x9;&#x9;&#x9;    fmt.Fprintf(os.Stdout, &amp;quot;%s\n&amp;quot;, flag.Arg(i))&#xA;&#x9;&#x9;    }&#xA;&#x9;    }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>cat in Go</title>
      <link>https://miek.nl/2009/november/18/cat-in-go/</link>
      <pubDate>Wed, 18 Nov 2009 19:57:00 +0000</pubDate>
      <guid>https://miek.nl/2009/november/18/cat-in-go/</guid>
      <description>&lt;p&gt;After spending every free minute to &lt;code&gt;Go&lt;/code&gt; I&amp;rsquo;m starting to get a feel&#xA;for the language. Every one has to start somewhere, so I decided to&#xA;&amp;ldquo;port&amp;rdquo; Unix utils to Go. I&amp;rsquo;m starting with &lt;code&gt;cat&lt;/code&gt;, and thanks to&#xA;the Go tutorial this is the result.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;package main&#xA;&#xA;// An implementation of Unix cat in Go&#xA;&#xA;import (&#xA;    &amp;quot;os&amp;quot;;&#xA;    &amp;quot;fmt&amp;quot;;&#xA;    &amp;quot;flag&amp;quot;;&#xA;)&#xA;&#xA;func cat(filename string) bool {&#xA;    const NBUF = 512;&#xA;    var buf [NBUF]byte;&#xA;    if f, e := os.Open(filename, os.O_RDONLY, 0); e != nil {&#xA;&#x9;    fmt.Fprintf(os.Stderr, &amp;quot;cat: error reading from %s: %s\n&amp;quot;,&#xA;&#x9;&#x9;    filename, e.String());&#xA;&#x9;    return true;&#xA;    } else {&#xA;&#x9;    for {&#xA;&#x9;&#x9;    switch nr, _ := f.Read(&amp;amp;buf); true {&#xA;&#x9;&#x9;    case nr &amp;lt; 0:&#xA;&#x9;&#x9;&#x9;    os.Exit(1)&#xA;&#x9;&#x9;    case nr == 0:&#x9;// EOF&#xA;&#x9;&#x9;&#x9;    return true&#xA;&#x9;&#x9;    case nr &amp;gt; 0:&#xA;&#x9;&#x9;&#x9;    if nw, ew := os.Stdout.Write(buf[0:nr]); nw != nr {&#xA;&#x9;&#x9;&#x9;&#x9;    fmt.Fprintf(os.Stderr,&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;    &amp;quot;cat: error writing from %s: %s\n&amp;quot;,&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;    filename, ew.String());&#xA;&#x9;&#x9;&#x9;&#x9;    return false;&#xA;&#x9;&#x9;&#x9;    }&#xA;&#x9;&#x9;    }&#xA;&#x9;    }&#xA;    }&#xA;    return true;&#xA;}&#xA;&#xA;func main() {&#xA;    flag.Parse();&#x9;// implement -n TODO&#xA;    if flag.NArg() == 0 {&#xA;&#x9;    cat(&amp;quot;/dev/stdin&amp;quot;)&#xA;    }&#xA;    for i := 0; i &amp;lt; flag.NArg(); i++ {&#xA;&#x9;    if !cat(flag.Arg(i)) {&#xA;&#x9;&#x9;    os.Exit(1)&#xA;&#x9;    }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In something like 50 lines you have a &lt;code&gt;cat&lt;/code&gt; program. I&amp;rsquo;m really starting&#xA;to like Go. Next up: extra features and a &lt;code&gt;grep&lt;/code&gt; command.&lt;/p&gt;</description>
    </item>
    <item>
      <title>First steps with Go</title>
      <link>https://miek.nl/2009/november/16/first-steps-with-go/</link>
      <pubDate>Mon, 16 Nov 2009 22:43:00 +0000</pubDate>
      <guid>https://miek.nl/2009/november/16/first-steps-with-go/</guid>
      <description>&lt;p&gt;I joined the go-nuts mailing list a few days ago and it really feels&#xA;good to receive 200+ emails per day again. Just like in the good old&#xA;days before good spam filtering (and anti-spam laws).&lt;/p&gt;&#xA;&lt;p&gt;I also re-watched the presentation Rob Pike gave for Google Tech Talks&#xA;on youtube.com. In there he presented the following program &lt;code&gt;chain.go&lt;/code&gt;:&#xA;(Formatted with &lt;code&gt;gofmt&lt;/code&gt; as it should)&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &amp;quot;flag&amp;quot;;&#xA;    &amp;quot;fmt&amp;quot;;&#xA;)&#xA;&#xA;var ngoroutine = flag.Int(&amp;quot;n&amp;quot;, 100000, &amp;quot;how may&amp;quot;)&#xA;&#xA;func f(left, right chan int)    { left &amp;lt;- 1+&amp;lt;-right }&#xA;&#xA;func main() {&#xA;    flag.Parse();&#xA;    leftmost := make(chan int);&#xA;&#xA;    var left, right chan int = nil, leftmost;&#xA;    for i := 0; i &amp;lt; *ngoroutine; i++ {&#xA;&#x9;    left, right = right, make(chan int);&#xA;&#x9;    go f(left, right);&#xA;    }&#xA;    right &amp;lt;- 0;             // bang!&#xA;    x := &amp;lt;-leftmost;        // wait for completion&#xA;    fmt.Println(x);         // 100000&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In this short program we make a chain of 100000 &lt;em&gt;goroutines&lt;/em&gt; which are&#xA;connected to each other. Each one adds 1 to the value it gets from its&#xA;right neighbor. We start it of by giving the last one (&lt;em&gt;right&lt;/em&gt;) a value&#xA;of 0. Then we wait until they are finished and print it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go language</title>
      <link>https://miek.nl/2009/november/13/go-language/</link>
      <pubDate>Fri, 13 Nov 2009 15:08:00 +0000</pubDate>
      <guid>https://miek.nl/2009/november/13/go-language/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been wanting to learn (and do something) with the language&#xA;&lt;a href=&#34;http://www.erlang.org&#34;&gt;Erlang&lt;/a&gt; for over two years now. But every time&#xA;I fire up &lt;code&gt;vim&lt;/code&gt; and start typing a get a &lt;em&gt;this-is-not-Unix&lt;/em&gt; feeling (aka&#xA;&lt;em&gt;Java-sickness&lt;/em&gt;). The syntax is just not right for me.&lt;/p&gt;&#xA;&lt;p&gt;But now Google, by the creators of Unix and C, give us&#xA;&lt;a href=&#34;http://www.golang.org&#34;&gt;Go&lt;/a&gt;! Which promises to give us Erlang&#xA;functionality in a C-like language. &lt;em&gt;Just what I wanted!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Basically just follow the steps on&#xA;&lt;a href=&#34;http://golang.org/doc/install.html&#34;&gt;golang.org&lt;/a&gt;. In short&#xA;it boils down to:&lt;/p&gt;</description>
    </item>
    <item>
      <title>gitvi (update)</title>
      <link>https://miek.nl/2009/february/02/gitvi-update/</link>
      <pubDate>Mon, 02 Feb 2009 22:14:00 +0000</pubDate>
      <guid>https://miek.nl/2009/february/02/gitvi-update/</guid>
      <description>&lt;p&gt;A&#xA;&lt;a href=&#34;http://www.atcomputing.nl/blog/authors/tonk/&#34;&gt;colleague&lt;/a&gt;&#xA;of mine had some nice improvements to &lt;code&gt;gitvi&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Right now &lt;code&gt;gitvi&lt;/code&gt; can be edited by itself, because the magic&#xA;sequence &lt;code&gt;$Hash$&lt;/code&gt; is escaped like this&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sed -i -e &#39;s/\$[H]ash:.*\$/$H&#39;&#39;ash$/&#39; &amp;quot;$base&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;(This was Ton&amp;rsquo;s idea)&lt;/p&gt;&#xA;&lt;p&gt;Some other improvements like a &lt;code&gt;-m MSG&lt;/code&gt; switch which allows&#xA;you to enter a commit message for all files you are editing.&lt;/p&gt;&#xA;&lt;p&gt;And of course it then also needs to have a &lt;code&gt;-h&lt;/code&gt; switch.&lt;/p&gt;</description>
    </item>
    <item>
      <title>check if a directory is empty in bash</title>
      <link>https://miek.nl/2008/april/19/check-if-a-directory-is-empty-in-bash/</link>
      <pubDate>Sat, 19 Apr 2008 10:20:00 +0000</pubDate>
      <guid>https://miek.nl/2008/april/19/check-if-a-directory-is-empty-in-bash/</guid>
      <description>&lt;p&gt;I had this small problem, how to you check if a directory is&#xA;empty in the shell? Suppose I want to do&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;cmd po/*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;this fails, if the &lt;code&gt;po&lt;/code&gt; directory is empty, which in turn makes my&#xA;compile barf, but that is another story.  I needed something to would&#xA;check the emptiness of the directory, and if it is not empty perform the&#xA;command, otherwise it skip it.&lt;/p&gt;&#xA;&lt;p&gt;The trick here is to remember that if a shell wildcard can not be&#xA;expanded it will be left alone. So an unexpanded &lt;code&gt;*&lt;/code&gt; will stay a &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
