mandag 8. mars 2010

Wannabe Linux "#¤(=¤/"!?%/¤

For some reason, we are using Cygwin at work to ease our scripting burden. It's a great tool for using bash-ish scripting power. Lately, my find command has behaved in strange ways. Whatever flags I pass, the result is always the same:


[/usr/bin] hasov@HKS-ADAMSTUA300 $ find
FIND: Parameter format not correct


After about 3 days this problem became unbearable, and I dedicated myself to hunt down the cause. Neither a cygwin upgrade, nor my configurations files was to blame. Windows stole my find !


[/usr/bin] hasov@HKS-ADAMSTUA300 $ which find
/cygdrive/c/WINDOWS/system32/find
[/usr/bin] hasov@HKS-ADAMSTUA300 $ rm `which find`
[/usr/bin] hasov@HKS-ADAMSTUA300 $ which find
/usr/bin/find
[/usr/bin] hasov@HKS-ADAMSTUA300 $ sleep 10s
[/usr/bin] hasov@HKS-ADAMSTUA300 $ which find
/cygdrive/c/WINDOWS/system32/find


Note that even though I remove the bogus find, some devil puts it back after a few seconds! Very strange indeed.

Anyway, I decided to get rid of the entire system32-thingy. I didn't want the break the fragile windows PATH variable, so I decided to handle the problem in .bashrc.
export PATH=`echo $PATH | sed -e 's/:\/cygdrive\/c\/WINDOWS\/system32:/:/'`


And that was just another nail in the windows/cygwin/hybrid coffin.