## Wednesday, March 23, 2011

### Why I like Linux, it's fast! Or, a quick typo fix in the CDK.

Last week there was a short git tutorial, resulting in a small test patch (feel free to ping me, if you like git training for the CDK too). Gaev some commit and review fame to Jules and Gilleain. I ran onto another 'Contructs' typo today, and decided to fix it. Linux is fast, and writing this blog post took more time to fix it:
$git checkout -b 266-14x-typo cdk-1.4.x$ grep -ri Contructs src/main | cut -d':' -f1 | \\
uniq | xargs replace Contructs Constructs --
$git format-patch -1  Patch report is here. #### 2 comments: 1. Hi Egon, I agree under LUNIX its much easier and portable, once you know awk, grep and pipe. Find and replace text in multiple files under Windows (XP,Vista,7) is possible with teh Mircosoft Powershell (one line): (get-childitem . -Include *.txt -Recurse) | select-string "CDK" -list |% { (get-content$_.Path) |% { $_ -replace "CDK", "XDK" } | set-content$_.Path }

The command replaces all CDK strings with XDK in all *.txt in all subfolders. Its quite fast too.

Other than that I would use Eclipse or Visual C++ Express to find and replace text under WIN.

And then again its probably easier to write a 5 liner in JAVA instead of learning powershell.

Or use Find And Replace Text
FART -r *.txt XDK CDK

http://sourceforge.net/projects/fart-it

Cheers
Tobias

2. Hej Tobias,

thanx for the tip. I am personally fond of Cygwin, bringing me POSIX to the windows platform. awk, perl, grep, pipe are a (de facto) standard. These tools are not tied to Linux.

The title of this post sucks indeed. It seems to imply a causal effect. What I meant was that I can work so efficiently on my laptop with Linux installed. It misses the GNU aspect, it doesn't reflect that GNU tools are available for other platforms, BSD and MS-Windows.

Sorry for being inaccurate, and thanx for the pointers!