<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Michael Li</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/michael_li/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/michael_li/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/michael_li//953</id>
    <updated>2011-09-28T08:46:25Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>find and exec</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/michael_li/2011/09/find-and-exec.html" />
    <id>tag:blogs.perl.org,2011:/users/michael_li//953.2230</id>

    <published>2011-09-28T08:40:31Z</published>
    <updated>2011-09-28T08:46:25Z</updated>

    <summary>first we can use find&apos;s exec opiton find . -name CVS -exec ls -dl {} \; also we can use shell for i in `find . -name CVS` ; do echo -n $i,&quot; &quot;; done change ls, echo to whatever...</summary>
    <author>
        <name>Michael Li</name>
        
    </author>
    
        <category term="Uxrt &amp; Lxrt" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="systemcommand" label="system command" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/michael_li/">
        <![CDATA[<p>first we can use find's exec opiton</p>

<p>find . -name CVS  -exec ls -dl {} \;</p>

<p>also we can use shell</p>

<p>for i in `find . -name CVS` ; do echo  -n $i," "; done</p>

<p>change ls, echo to whatever suits you, like rm -rf <br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>cmd to compare contents of two directories</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/michael_li/2011/09/cmd-to-compare-contents-of-two-directories.html" />
    <id>tag:blogs.perl.org,2011:/users/michael_li//953.2161</id>

    <published>2011-09-02T04:35:20Z</published>
    <updated>2011-09-02T04:38:00Z</updated>

    <summary>diff -qr dir1 dir2...</summary>
    <author>
        <name>Michael Li</name>
        
    </author>
    
        <category term="Uxrt &amp; Lxrt" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/michael_li/">
        <![CDATA[<p>diff -qr dir1 dir2</p>]]>
        
    </content>
</entry>

<entry>
    <title>How to remove a carriage return (\r\n)</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/michael_li/2011/08/how-to-remove-a-carriage-return-rn.html" />
    <id>tag:blogs.perl.org,2011:/users/michael_li//953.2091</id>

    <published>2011-08-15T10:39:13Z</published>
    <updated>2011-08-15T10:40:15Z</updated>

    <summary>use strict; use warnings; { my $str = &quot;abcd\r\n&quot;; $str =~ s/\r|\n//g; print &quot;[$str]&quot;; } { my $str = &quot;abcd\n&quot;; $str =~ s/\r|\n//g; print &quot;[$str]&quot;; } { my $str = &quot;abcd\r&quot;; $str =~ s/\r|\n//g; print &quot;[$str]&quot;; }...</summary>
    <author>
        <name>Michael Li</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/michael_li/">
        <![CDATA[<p>use strict;<br />
use warnings;</p>

<p>{<br />
    my $str = "abcd\r\n";<br />
    $str =~ s/\r|\n//g;<br />
    print "[$str]";<br />
}</p>

<p>{<br />
    my $str = "abcd\n";<br />
    $str =~ s/\r|\n//g;<br />
    print "[$str]";<br />
}</p>

<p>{<br />
    my $str = "abcd\r";<br />
    $str =~ s/\r|\n//g;<br />
    print "[$str]";<br />
}</p>]]>
        
    </content>
</entry>

<entry>
    <title>Check Eclipse Hot keys</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/michael_li/2011/08/check-eclipse-hot-keys.html" />
    <id>tag:blogs.perl.org,2011:/users/michael_li//953.2090</id>

    <published>2011-08-15T07:45:27Z</published>
    <updated>2011-08-15T07:51:23Z</updated>

    <summary>open Eclipse press Control-Shift-L. Alt-left arrow: Go back in navigation history. Alt-right arrow: Go forward....</summary>
    <author>
        <name>Michael Li</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/michael_li/">
        <![CDATA[<p>open Eclipse press Control-Shift-L.</p>

<p>Alt-left arrow: Go back in navigation history. <br />
Alt-right arrow: Go forward. </p>]]>
        
    </content>
</entry>

<entry>
    <title>MySQL DATE_SUB()</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/michael_li/2011/08/mysql-date-sub.html" />
    <id>tag:blogs.perl.org,2011:/users/michael_li//953.2084</id>

    <published>2011-08-12T08:48:39Z</published>
    <updated>2011-08-12T08:49:35Z</updated>

    <summary>SELECT OrderId,DATE_SUB(OrderDate,INTERVAL 2 DAY) AS OrderPayDate FROM Orders...</summary>
    <author>
        <name>Michael Li</name>
        
    </author>
    
    <category term="mysql" label="MySQL" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/michael_li/">
        <![CDATA[<p>SELECT OrderId,DATE_SUB(OrderDate,INTERVAL 2 DAY) AS OrderPayDate<br />
FROM Orders</p>]]>
        
    </content>
</entry>

<entry>
    <title>use variable from other module</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/michael_li/2011/08/use-variable-from-other-module.html" />
    <id>tag:blogs.perl.org,2011:/users/michael_li//953.2083</id>

    <published>2011-08-12T07:37:53Z</published>
    <updated>2011-08-12T07:43:38Z</updated>

    <summary>In module bait we have our %IMAGEPADV = ( &apos;SxRT-5.1&apos; =&gt; [ qw(sol_sparc sol_x64) ], &apos;LxRT-5.1&apos; =&gt; [qw(rhel5_x86_64 sles10_x86_64 sles11_x86_64)], ... ); In my own module use this to access %IMAGEPADV %bait::IMAGEPADV...</summary>
    <author>
        <name>Michael Li</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/michael_li/">
        <![CDATA[<p>In module bait we have</p>

<p>our %IMAGEPADV = (<br />
    'SxRT-5.1' => [ qw(sol_sparc sol_x64) ],<br />
    'LxRT-5.1' => [qw(rhel5_x86_64 sles10_x86_64 sles11_x86_64)],<br />
    ...<br />
);</p>

<p>In my own module use this to access %IMAGEPADV</p>

<p>%bait::IMAGEPADV<br />
</p>]]>
        
    </content>
</entry>

</feed>
