<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7801187115185772556</id><updated>2011-07-08T08:35:19.659-07:00</updated><category term='forms'/><category term='windows'/><category term='ispell'/><category term='cvs'/><category term='emacs'/><category term='cpp'/><category term='powershell'/><category term='oracle'/><category term='mueller'/><category term='dictionary'/><title type='text'>With small steps...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-7526228594316408415</id><published>2010-05-05T07:38:00.000-07:00</published><updated>2010-08-08T02:22:06.090-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><title type='text'>FIND+GREP replacement for PowerShell</title><content type='html'>&lt;p&gt;It's pretty common in UNIX world to use &lt;tt&gt;find&lt;/tt&gt; in conjunction with &lt;tt&gt;grep&lt;/tt&gt; for searching filesystem tree for something.  Would it be searching for specific class in source code tree:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ find -name \*.cpp -o -name \*.hpp -exec grep -Hb class {} \;&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;Or just searching for some word in your notes, doesn't matter, but it is really common.  So what do we have in PowerShell world to substitute those commands?&lt;/p&gt;&lt;p&gt;First of all, let's try to replace &lt;tt&gt;grep&lt;/tt&gt;.  For this we have cmdlet called &lt;tt&gt;Select-String&lt;/tt&gt;, or &lt;tt&gt;sls&lt;/tt&gt; (an alias). Let's try something simple:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ sls class *.hpp&lt;br /&gt;&lt;br /&gt;CustomTimeEdit.hpp:5:class CustomTimeEdit : public QTimeEdit {&lt;br /&gt;DaySelecter.hpp:12:    class Model : public QAbstractItemModel&lt;br /&gt;DaySelecter.hpp:43:    class View : public QTreeView&lt;br /&gt;[...]&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;For some reason, documentation got this messed up, saying path should go first, and pattern second, but anyway.&lt;/p&gt;&lt;p&gt;What if we want to search files, whose names match several patterns (for example, cpp and hpp files):&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ sls DaySelector *.hpp,*.cpp&lt;br /&gt;&lt;br /&gt;DaySelecter.hpp:1:#ifndef __DAYSELECTER_HPP__&lt;br /&gt;DaySelecter.hpp:2:#define __DAYSELECTER_HPP__&lt;br /&gt;DaySelecter.hpp:10:namespace DaySelecter {&lt;br /&gt;[...]&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;What if we want to match &lt;b&gt;several patterns&lt;/b&gt; in those files?&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ sls DaySelector,MainWindow *.hpp,*.cpp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DaySelecter.hpp:1:#ifndef __DAYSELECTER_HPP__&lt;br /&gt;DaySelecter.hpp:2:#define __DAYSELECTER_HPP__&lt;br /&gt;DaySelecter.hpp:10:namespace DaySelecter {&lt;br /&gt;MainWindow.hpp:1:#ifndef __MAINWINDOW_HPP__&lt;br /&gt;MainWindow.hpp:2:#define __MAINWINDOW_HPP__&lt;br /&gt;MainWindow.hpp:4:#include &lt;qmainwindow&gt;&lt;br /&gt;[...]&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;The fact is, for both pattern and path &lt;tt&gt;Select-String&lt;/tt&gt; accepts &lt;b&gt;arrays&lt;/b&gt; (which in PowerShell are specified with comma operator).&lt;/p&gt;&lt;p&gt;Now you remember PowerShell operates with objects, not text, yes?  So let's see, what those objects are:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ sls DaySelector *.hpp,*.cpp | gm&lt;br /&gt;&lt;br /&gt;TypeName: Microsoft.PowerShell.Commands.MatchInfo&lt;br /&gt;&lt;br /&gt;Name         MemberType Definition&lt;br /&gt;----         ---------- ----------&lt;br /&gt;Equals       Method     bool Equals(System.Object obj)&lt;br /&gt;GetHashCode  Method     int GetHashCode()&lt;br /&gt;GetType      Method     type GetType()&lt;br /&gt;RelativePath Method     string RelativePath(string directory)&lt;br /&gt;ToString     Method     string ToString(), string ToString(string directory)&lt;br /&gt;Context      Property   Microsoft.PowerShell.Commands.MatchInfoContext Context {get;set;}&lt;br /&gt;Filename     Property   System.String Filename {get;}&lt;br /&gt;IgnoreCase   Property   System.Boolean IgnoreCase {get;set;}&lt;br /&gt;Line         Property   System.String Line {get;set;}&lt;br /&gt;LineNumber   Property   System.Int32 LineNumber {get;set;}&lt;br /&gt;Matches      Property   System.Text.RegularExpressions.Match[] Matches {get;set;}&lt;br /&gt;Path         Property   System.String Path {get;set;}&lt;br /&gt;Pattern      Property   System.String Pattern {get;set;}&lt;br /&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;Not just we can look at the output, we can cut the pieces of output with ease (no more &lt;tt&gt;sed&lt;/tt&gt; scripts for command output parsing!), we can &lt;b&gt;analyze&lt;/b&gt; output easily.  That's pretty exciting, I think.  That's the future of command-line.  But I'm off the road.&lt;/p&gt;&lt;p&gt;I think, you've got the idea. With &lt;tt&gt;sls&lt;/tt&gt; you can perform regexp matching (default behaviour), simple matching (&lt;tt&gt;-SimpleMatch&lt;/tt&gt;), search for just first match in file, ignoring all others (&lt;tt&gt;-List&lt;/tt&gt;), or, on the contrary, search for &lt;b&gt;all&lt;/b&gt; matches, even if several are present on the same line (&lt;tt&gt;-AllMatches&lt;/tt&gt;), do negative matching (&lt;tt&gt;-NotMatch&lt;/tt&gt;). You can also obtain results in context of several lines forward and backward (&lt;tt&gt;-Context&lt;/tt&gt; option), pretty like &lt;tt&gt;diff -u&lt;/tt&gt; does.  What's more, you can even specify different encoding, though this list, for some reason, is far from complete: it contains only Unicode encodings, ANSI and OEM, which is sufficient in most cases, but the list could have been more diverse.&lt;/p&gt;&lt;p&gt;Now what about searching the &lt;b&gt;tree&lt;/b&gt;.  In PowerShell, we use &lt;tt&gt;Get-ChildItem&lt;/tt&gt;, or &lt;tt&gt;ls&lt;/tt&gt;. I don't know full powers of UNIX &lt;tt&gt;ls&lt;/tt&gt;, but PowerShell &lt;tt&gt;ls&lt;/tt&gt; is pretty powerful thing.  We can find all files in the tree, matching specific patterns:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ ls -r -inc *.cpp,*.hpp&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;Or we can find files, &lt;b&gt;not&lt;/b&gt; matching pattern:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ ls -r -ex *.hpp~&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;Or we can even do some crazy stuff, matching some files and then&lt;br /&gt;excluding some files, not matching specific pattern:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ ls -r -inc *.cpp,*.hpp -ex DaySelecter*&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;If you want more control over matching, you can process matching files with &lt;tt&gt;Where-Object&lt;/tt&gt; block -- remember? PowerShell operates on objects, not text:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ ls -r -inc *.cpp,*.hpp -ex DaySelecter* | ? { $_.IsReadOnly }&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;Ok, now, how we can use powers of &lt;tt&gt;ls&lt;/tt&gt; with &lt;tt&gt;sls&lt;/tt&gt;?  The answer is, &lt;tt&gt;sls&lt;/tt&gt; can accept files not only from command line, but from pipe as well, so we can just &lt;b&gt;pipe&lt;/b&gt; both commands together, and get the result desired:&lt;/p&gt;&lt;p&gt;&lt;tt&gt;&lt;br /&gt;$ ls -r -inc *.cpp,*.hpp -ex *DaySelecter* | sls DaySelecter&lt;br /&gt;&lt;br /&gt;MainWindow.cpp:26:    connect(viewDaySelecter-&gt;selectionModel(),&lt;br /&gt;MainWindow.cpp:38:    viewDaySelecter-&gt;setDiary(diaryModel);&lt;br /&gt;&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;Now &lt;b&gt;that's&lt;/b&gt; some powers we need!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-7526228594316408415?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/7526228594316408415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=7526228594316408415' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/7526228594316408415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/7526228594316408415'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2010/05/findgrep-replacement-for-powershell.html' title='FIND+GREP replacement for PowerShell'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-4324854772785441813</id><published>2010-03-31T23:48:00.000-07:00</published><updated>2010-03-31T23:49:57.217-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ispell'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>Configuring GNU Emacs 23 + Ispell + Russian Dictionary + Windows</title><content type='html'>Emacs ispell package is capable of running both Ispell and Aspell, but&lt;br /&gt;as far as I've tried Aspell, it gives some nonsensical results. Maybe this &lt;br /&gt;was due to some misconfiguration, but I wasn't eager to sort it out.&lt;br /&gt;&lt;br /&gt;So I went with Ispell. Configuring it is also a bit of obscure process, so &lt;br /&gt;I thought it would be good to have an installation guide step by step:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Download Ispell from &lt;a href="ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Humblet_Pierre_A/V1.1/ispell-3.2.06-cygwin-1.3-bin.tar.gz"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You should have Cygwin installed on your machine. Let's say, it is in folder &lt;tt&gt;c:\Programs\Cygwin&lt;/tt&gt;.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Unpack aforementioned Ispell to your Cygwin directory.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Go to &lt;tt&gt;c:\Programs\Cygwin\usr\local\bin&lt;/tt&gt; and copy &lt;tt&gt;ispell.exe&lt;/tt&gt; to &lt;tt&gt;c:\Programs\Cygwin\bin&lt;/tt&gt;. This is needed to run ispell directly from Windows, bypassing Cygwin shells.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Download russian dictionaries from &lt;a href="ftp://scon155.phys.msu.su/pub/russian/ispell/rus-ispell.tar.gz"&gt;here&lt;/a&gt; and unpack them to some temporary folder. Let's say it would be &lt;tt&gt;d:\temp&lt;/tt&gt;.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Run Cygwin shell and perform the following commands (modify them appropriately):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /cygdrive/d/temp&lt;br /&gt;make win&lt;br /&gt;mv russian.hash russianw.hash&lt;br /&gt;mv russian.aff russianw.aff&lt;br /&gt;mv russianw.* /usr/local/lib&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;From now on, you sould be able to check files encoded in windows-1251 charset directly under Cygwin, like that:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;LANG=ru_RU ispell -drussianw file.txt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Or, under &lt;tt&gt;cmd.exe&lt;/tt&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;set LANG=ru_RU.CP1251&lt;br /&gt;c:\Programs\Cygwin\bin\ispell.exe -drussianw file.txt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Now all we need to do is to configure Emacs correctly. Add the following lines to your dotemacs:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(setq ispell-program-name "c:\\Programs\\cygwin\\bin\\ispell.exe")&lt;br /&gt;(setq ispell-dictionary "russianw")&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;This should do the task. Now restart emacs and try running ispell on some file.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-4324854772785441813?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/4324854772785441813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=4324854772785441813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/4324854772785441813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/4324854772785441813'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2010/03/configuring-gnu-emacs-23-ispell-russian.html' title='Configuring GNU Emacs 23 + Ispell + Russian Dictionary + Windows'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-422852349114439966</id><published>2008-07-04T10:01:00.000-07:00</published><updated>2008-07-04T10:05:52.592-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>Disable arrow keys in Emacs</title><content type='html'>So for this habit is ineradicable by will and my hands a little ache after hour or two of code surfing, I've decided just to disable this keys in my &lt;tt&gt;.emacs&lt;/tt&gt;. Here we go:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(global-unset-key [(up)])&lt;br /&gt;(global-unset-key [(down)])&lt;br /&gt;(global-unset-key [(left)])&lt;br /&gt;(global-unset-key [(right)])&lt;br /&gt;(global-unset-key [(prior)])&lt;br /&gt;(global-unset-key [(next)])&lt;br /&gt;(global-unset-key [(home)])&lt;br /&gt;(global-unset-key [(next)])&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-422852349114439966?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/422852349114439966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=422852349114439966' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/422852349114439966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/422852349114439966'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2008/07/disable-arrow-keys-in-emacs.html' title='Disable arrow keys in Emacs'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-1341650364763361431</id><published>2007-11-03T00:52:00.000-07:00</published><updated>2007-11-03T00:58:17.004-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cpp'/><title type='text'>Про C++</title><content type='html'>Плюсы -- подлый язык. Когда пишешь на C -- ставишь во главу стола производительность, когда пишешь на чем-то более высокоуровневом (будь то Python, или, прости господи, Lisp) -- пляшешь от ясного выражения концепций в конструкциях языка.&lt;br /&gt;&lt;br /&gt;Когда же пишешь на плюсах, все время пытаешься усидеть на двух стульях разом (что вернуть -- список или итератор, или указатель? список чего? указателей или объектов? уф... и т.д. и т.п.) :( Может, с опытом это пройдет.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-1341650364763361431?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/1341650364763361431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=1341650364763361431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/1341650364763361431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/1341650364763361431'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2007/11/c.html' title='Про C++'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-7456057278800208854</id><published>2007-09-27T10:51:00.000-07:00</published><updated>2007-09-27T11:27:02.944-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='forms'/><category scheme='http://www.blogger.com/atom/ns#' term='cvs'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Managing Oracle Forms CVS tree under Powershell</title><content type='html'>At work, I have to deal with Oracle Forms, which itself is a tool for creating data access forms in a visual way. This tool stores forms as a binary files (.fmb's), so managing them under ordinary version control system like CVS is a pain, because I can't see what changes were made to form (if any). In spite of that, CVS is my only available option.&lt;br /&gt;&lt;br /&gt;Fortunately, Oracle Developer Suite has a tool, &lt;tt&gt;frmf2xml&lt;/tt&gt; which can be used to convert binary FMB file to XML, so, gluing it all together (cvs, frmf2xml and ordinary diff utility) with PowerShell, I have written a script, &lt;tt&gt;Compare-CvsForms&lt;/tt&gt;, which is much like &lt;tt&gt;cvs diff&lt;/tt&gt; command, but works with theese binary forms. Actually, I've also written &lt;tt&gt;vdiff.py&lt;/tt&gt; script, based on difflib, which is much more convenient for comparing such a messy data (XML, huh).&lt;br /&gt;&lt;br /&gt;So, here is the &lt;tt&gt;Compare-CvsForms.ps1&lt;/tt&gt; script (I've put it to my PowerShell profile directory):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Param ([string]$formsFile)&lt;br /&gt;&lt;br /&gt;if (cvs status $formsFile |&lt;br /&gt;select-string 'Status: (Locally Modified|Needs Checkout|Needs Patch)')&lt;br /&gt;{&lt;br /&gt;# store working copy in another place&lt;br /&gt;$local:temp_fmb = [System.IO.Path]::ChangeExtension(&lt;br /&gt; [System.IO.Path]::GetTempFileName(), "fmb")&lt;br /&gt;$local:temp_xml = [System.IO.Path]::ChangeExtension(&lt;br /&gt; [System.IO.Path]::GetTempFileName(), "xml")&lt;br /&gt;Move-Item -force $formsFile $local:temp_fmb&lt;br /&gt;# produce xml of a working copy&lt;br /&gt;frmf2xml $local:temp_fmb | out-null&lt;br /&gt;if ($LastExitCode -ne 0) {&lt;br /&gt;Echo "ERROR: Cannot convert working copy of form to XML!"&lt;br /&gt;Move-Item -Force $local:temp_fmb $formsFile&lt;br /&gt;return&lt;br /&gt;}&lt;br /&gt;# get repositary copy&lt;br /&gt;cvs update 2&gt;&amp;amp;1 | out-null&lt;br /&gt;#produce xml of a repositary copy&lt;br /&gt;frmf2xml $formsFile | out-null&lt;br /&gt;if ($LastExitCode -ne 0) {&lt;br /&gt;Echo "ERROR: Cannot convert CVS copy of form to XML!"&lt;br /&gt;Move-Item -Force $local:temp_fmb $formsFile&lt;br /&gt;Remove-Item -Force $xml_from&lt;br /&gt;return&lt;br /&gt;}&lt;br /&gt;# compare xmls&lt;br /&gt;$xml_from=$formsFile.substring(0, $formsFile.length-4) + "_fmb.xml"&lt;br /&gt;$xml_to=$local:temp_fmb.substring(0, $local:temp_fmb.length-4) + "_fmb.xml"&lt;br /&gt;vdiff.py -context $xml_from $xml_to&lt;br /&gt;if ($LastExitCode -eq 0) {&lt;br /&gt;$formsFile.toUpper() + ": Working copy does not differ from repositary."&lt;br /&gt;}&lt;br /&gt;Move-Item -Force $local:temp_fmb $formsFile&lt;br /&gt;Remove-Item -Force $xml_to,$xml_from&lt;br /&gt;} else {&lt;br /&gt;$formsFile.toUpper() + ": Working copy is up to date."&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And &lt;tt&gt;vdiff.py&lt;/tt&gt; (pretty straightforward) script (surely, you should have Python installed, if not - you could just as easily replace this script with ordinary &lt;tt&gt;diff&lt;/tt&gt; utility):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/python&lt;br /&gt;import os&lt;br /&gt;import sys&lt;br /&gt;import difflib&lt;br /&gt;import tempfile&lt;br /&gt;&lt;br /&gt;program_name = os.path.splitext(os.path.basename(os.path.sys.argv[0]))[0].upper()&lt;br /&gt;browser = "c:\\Program Files\\Internet Explorer\\iexplore.exe"&lt;br /&gt;&lt;br /&gt;if len(sys.argv) &amp;lt; 3:&lt;br /&gt;  print "\nUSAGE:\n\n    %s FROM-FILE TO-FILE\n" % program_name&lt;br /&gt;  sys.exit(2)&lt;br /&gt;&lt;br /&gt;if sys.argv[1] == "-context":&lt;br /&gt;  context = True&lt;br /&gt;  from_fn = sys.argv[2]&lt;br /&gt;  to_fn = sys.argv[3]&lt;br /&gt;else:&lt;br /&gt;  context = False&lt;br /&gt;  from_fn = sys.argv[1]&lt;br /&gt;  to_fn = sys.argv[2]&lt;br /&gt;&lt;br /&gt;try:&lt;br /&gt;  from_lines = open(from_fn).readlines()&lt;br /&gt;except IOError:&lt;br /&gt;  print "%s: Error while reading file -- %2" % (program_name, from_fn)&lt;br /&gt;  sys.exit(1)&lt;br /&gt;&lt;br /&gt;try:&lt;br /&gt;  to_lines = open(to_fn).readlines()&lt;br /&gt;except IOError:&lt;br /&gt;  print "%s: Error while reading file -- %2" % (program_name, to_fn)&lt;br /&gt;  sys.exit(1)&lt;br /&gt;&lt;br /&gt;differs = False&lt;br /&gt;for x in difflib.context_diff(from_lines, to_lines):&lt;br /&gt;  differs = True&lt;br /&gt;  break&lt;br /&gt;&lt;br /&gt;if differs:&lt;br /&gt;  diff = difflib.HtmlDiff(wrapcolumn=70).make_file(from_lines, to_lines, from_fn, to_fn, context)&lt;br /&gt;  diff = diff.replace("&amp;lt;head&amp;gt;",&lt;br /&gt;                      '&amp;lt;head&amp;gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;')&lt;br /&gt;  tmp = tempfile.mkstemp(".html")&lt;br /&gt;  os.write(tmp[0], diff)&lt;br /&gt;  os.close(tmp[0])&lt;br /&gt;  os.spawnl(os.P_WAIT, browser, ' file://' + tmp[1] + '')&lt;br /&gt;  sys.exit(1)&lt;br /&gt;else:&lt;br /&gt;  sys.exit(0)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Scripting with PowerShell actually is a great deal of fun :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-7456057278800208854?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/7456057278800208854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=7456057278800208854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/7456057278800208854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/7456057278800208854'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2007/09/managing-oracle-forms-cvs-tree-under.html' title='Managing Oracle Forms CVS tree under Powershell'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-5174499570496641621</id><published>2007-06-15T10:42:00.000-07:00</published><updated>2007-06-15T11:10:05.545-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><title type='text'>A little correction to Process-File function</title><content type='html'>Once after processing my C++ source code tree with Process-File my sources became uncompilable. The problem was caused by redirection operator `&gt;', which transformed source files from plain-old ASCII to Unicode. So there's corrected version which uses Out-File cmdlet instead with encoding specified explicitly:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Process-File([scriptblock]$script, &lt;br /&gt;                      $filename, &lt;br /&gt;                      $encoding = "ascii") {&lt;br /&gt;    $local:temp = New-TempFileName&lt;br /&gt;    Get-Content -Encoding $encoding $filename | `&lt;br /&gt;          Foreach $script | `&lt;br /&gt;          out-file -encoding $encoding $local:temp&lt;br /&gt;    Move-Item -force $local:temp $filename&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-5174499570496641621?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/5174499570496641621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=5174499570496641621' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/5174499570496641621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/5174499570496641621'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2007/06/little-correction-to-process-file.html' title='A little correction to Process-File function'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-2189596450088177166</id><published>2007-04-28T01:11:00.000-07:00</published><updated>2007-04-28T01:35:54.862-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mueller'/><category scheme='http://www.blogger.com/atom/ns#' term='dictionary'/><title type='text'>Proper conversion of Mueller dictionary to Unicode</title><content type='html'>&lt;strong&gt;Note:&lt;/strong&gt; this article is a (bad) translation of my article on this subject written in russian.&lt;br /&gt;&lt;br /&gt;This article describes more proper than Ubuntu (and maybe Debian) current package offers  conversion of a Mueller dictionary to &lt;tt&gt;Unicode &lt;/tt&gt;(&lt;tt&gt;UTF-8&lt;/tt&gt;) with consequent conversion to &lt;tt&gt;dict &lt;/tt&gt;format.&lt;br /&gt;There is some reasons for doing this job:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Existing conversion from Mueller to &lt;tt&gt;dict&lt;/tt&gt; has a few first dictionary articles corrupted (the ones that describe dictionary terms). I suppose this was caused by executing conversion script (&lt;tt&gt;to-dict&lt;/tt&gt;) in the wrong locale. It should be executed in &lt;tt&gt;KOI8-R&lt;/tt&gt;, not &lt;tt&gt;UTF-8&lt;/tt&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;More to that, original dictionary contains not just plain &lt;tt&gt;KOI8-R&lt;/tt&gt; text, but &lt;tt&gt;SilIPA&lt;/tt&gt;-encoded word transcriptions too. These transcriptions should be handled separately with "SilIPA-to-Unicode IPA Extensions" conversion.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;More to that, the script &lt;tt&gt;to-dict&lt;/tt&gt; itself contains a little bug, which caused some words starting with non-alphabetical character (dictionary terms, other words starting with dash or apostroph -- like 'cause, -shaped) to be excluded from dictionary index &lt;strong&gt;at all!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So I've decided to convert dictionary by myself. If you want to convert dictionary using my method, you'll have to download my script &lt;a href="http://uj2.h15.ru/mutf/correct-translation.pl"&gt;correct-translation.pl&lt;/a&gt; and corrected script &lt;a href="http://uj2.h15.ru/mutf/to-dict"&gt;to-dict&lt;/a&gt; (corrections -- script text converted to UTF-8 and options &lt;tt&gt;--allchars --utf8&lt;/tt&gt; in &lt;tt&gt;dictfmt&lt;/tt&gt; call).&lt;br /&gt;&lt;p&gt;So, lets start. First of all, create temporary directory and put there original dictionary and those scripts:&lt;br /&gt;&lt;/p&gt;     &lt;pre&gt;~$ mkdir /tmp/mutf&lt;br /&gt;~$ cd /tmp/mutf/&lt;br /&gt;/tmp/mutf$ wget http://uj2.h15.ru/mutf/correct-translation.pl&lt;br /&gt;...&lt;br /&gt;/tmp/mutf$ wget http://uj2.h15.ru/mutf/to-dict&lt;br /&gt;...&lt;br /&gt;/tmp/mutf$ wget http://some.where/Mueller7GPL.koi&lt;br /&gt;...&lt;br /&gt;/tmp/mutf$ chmod 755 correct-translation.pl to-dict&lt;br /&gt;/tmp/mutf$ ls -l&lt;br /&gt;итого 5608&lt;br /&gt;-rwxr-xr-x  1 andrey andrey     531 2005-07-06 16:20 correct-translation.pl&lt;br /&gt;-rw-r--r--  1 andrey andrey 5714222 2005-07-06 16:23 Mueller7GPL.koi&lt;br /&gt;-rwxr-xr-x  1 andrey andrey    6302 2005-07-06 16:22 to-dict&lt;br /&gt;/tmp/mutf$&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; sorry, I can't put this scripts to some more "permanent" storage, but I can mail them to you if you can't download them.&lt;br /&gt;Now, we're going to translate dictionary to &lt;tt&gt;UTF-8&lt;/tt&gt;. Firstly, we need to convert dictionary using &lt;tt&gt;iconv&lt;/tt&gt; and then, we need to correct transcriptions with &lt;tt&gt;correct-translation.pl&lt;/tt&gt;:&lt;br /&gt;&lt;pre&gt;/tmp/mutf$ cat Mueller7GPL.koi | iconv -f koi8-r -t utf-8 | \&lt;br /&gt;&gt; ./correct-translation.pl &gt; Mueller7GPL.utf &amp;&amp;amp; rm -f Mueller7GPL.koi&lt;br /&gt;/tmp/mutf$&lt;br /&gt;&lt;/pre&gt;Now we will convert dictionary to &lt;tt&gt;dict&lt;/tt&gt; format:&lt;br /&gt;&lt;pre&gt;/tmp/mutf$ ./to-dict --src-data Mueller7GPL.utf mueller7.data&lt;br /&gt;Writing the header of mueller7.data..&lt;br /&gt;Formatting data (Mueller7GPL.utf -&gt; mueller7.data)..&lt;br /&gt;.&lt;br /&gt;/tmp/mutf$ ./to-dict --data-dict mueller7.data mueller7 &amp;&amp;amp; rm -f mueller7.data&lt;br /&gt;dictfmt: mueller7.data -&gt; mueller7.dict and mueller7.index..&lt;br /&gt;46185 headwords&lt;br /&gt;Compressing mueller7.dict..&lt;br /&gt;.&lt;br /&gt;/tmp/mutf$&lt;br /&gt;&lt;/pre&gt;Now we just need to install dictionary:&lt;br /&gt;&lt;pre&gt;/tmp/mutf$ cp mueller7.* /usr/share/dictd/&lt;br /&gt;/tmp/mutf$ dictdconfig -w &amp;&amp;amp;amp; (killall dictd; dictd)&lt;br /&gt;&lt;/pre&gt;Resulting article can look like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_6IyUOAMYhLw/RjMDYZJZjII/AAAAAAAAAAM/UEydETrE6TU/s1600-h/mutf.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_6IyUOAMYhLw/RjMDYZJZjII/AAAAAAAAAAM/UEydETrE6TU/s320/mutf.png" alt="" id="BLOGGER_PHOTO_ID_5058390524069252226" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-2189596450088177166?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/2189596450088177166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=2189596450088177166' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/2189596450088177166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/2189596450088177166'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2007/04/proper-conversion-of-mueller-dictionary.html' title='Proper conversion of Mueller dictionary to Unicode'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_6IyUOAMYhLw/RjMDYZJZjII/AAAAAAAAAAM/UEydETrE6TU/s72-c/mutf.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-6032100678359477139</id><published>2007-02-12T09:02:00.000-08:00</published><updated>2007-02-12T09:25:54.855-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>Integrating Emacs kill-ring and Windows clipboard</title><content type='html'>Since I've started using Emacs on Windows, there was one little problem irritating my mind everyday -- by default, GNU Emacs 22 separates kill-ring and Windows clipboard contents, making it &lt;span style="font-weight: bold;"&gt;REALLY&lt;/span&gt; hard to use clipboard -- you can paste text by only pressing mouse-3 (the wheel) on editor window, and you can copy text only by selecting it with your mouse -- no handy &lt;span style="font-family:courier new;"&gt;C-y&lt;/span&gt;, no integration with kill ring.&lt;br /&gt;&lt;br /&gt;So I did a little "investigation". There are two variables controlling mentioned integration -- &lt;span style="font-family:courier new;"&gt;interprogram-cut-function&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;interprogram-paste-function&lt;/span&gt; (described in emacs online documentation, which see). First of which holds function used to send killed text to clipboard, and the second one holds function used to get fresh clipboard text back from clipboard and put it to kill-ring. More to that, file &lt;span style="font-family:courier new;"&gt;w32-fns.el&lt;/span&gt; in your emacs site-lisp tree contains the next (as well as definitions for those functions -- &lt;span style="font-family:courier new;"&gt;x-select-text&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;x-get-selection-valu&lt;/span&gt;e):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  (setq interprogram-cut-function 'x-select-text)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  (setq interprogram-paste-function 'x-get-selection-value)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But for some reason this file isn't loaded on Emacs startup. So, what should we do is to add some loading code to our dotemacs file (do not forget to wrap-n-protect it with some kind of Win32-only conditional -- `&lt;span style="font-family:courier new;"&gt;(Windows body ...)&lt;/span&gt;' macro in my case):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;(Windows&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  (load "w32-fns"))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Voila! Now text from clipboard goes right to the kill-ring and vice versa.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-6032100678359477139?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/6032100678359477139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=6032100678359477139' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/6032100678359477139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/6032100678359477139'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2007/02/integrating-emacs-kill-ring-and-windows.html' title='Integrating Emacs kill-ring and Windows clipboard'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7801187115185772556.post-3616426366251345439</id><published>2007-01-07T07:42:00.000-08:00</published><updated>2007-01-07T08:07:17.232-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><title type='text'>Process-File function</title><content type='html'>Some time ago while scripting (either bash or PowerShell) I've found myself using some pattern too often. It can be expressed as&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; take a file; &lt;/li&gt;&lt;li&gt;process every line in it; &lt;/li&gt;&lt;li&gt; save file back.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;E.g. `sed -i' provides this kind of functionality. This was kind of boring, because you can't just write "cat file.txt | do-something &gt; file.txt", and if you really could, this was too long anyway. So I wrote function which does just that -- takes file, processes it with some code (specified as an argument), and writes it back. Here it goes:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;function Process-File([scriptblock]$script, $filename) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$local:temp = [System.IO.Path]::GetTempFileName()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Get-Content $filename | Foreach $script &gt; $local:temp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Move-Item -force $local:temp $filename&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here some testing code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;PS C:\Documents and Settings\andrey&gt; cat test.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;PS C:\Documents and Settings\andrey&gt; echo "abcabc" &gt; test.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;PS C:\Documents and Settings\andrey&gt; cat test.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;abcabc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;PS C:\Documents and Settings\andrey&gt; Process-File { $_ -replace 'a','b' } test.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;PS C:\Documents and Settings\andrey&gt; cat test.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;bbcbbc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;PS C:\Documents and Settings\andrey&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PowerShell is just wonderfull.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7801187115185772556-3616426366251345439?l=uj2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uj2.blogspot.com/feeds/3616426366251345439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7801187115185772556&amp;postID=3616426366251345439' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/3616426366251345439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7801187115185772556/posts/default/3616426366251345439'/><link rel='alternate' type='text/html' href='http://uj2.blogspot.com/2007/01/process-file-function.html' title='Process-File function'/><author><name>uj</name><uri>http://www.blogger.com/profile/12844853230157318459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
