Cygwin: Still Awesome

Sep 8

Cygwin: Still Awesome

I opined a few months ago on the beauty and joy of the command line, but I had another experience today that really illustrated the fact that GUI’s aren’t the best tool for everything.

I have both the privilege and burden of dealing with Rational Clearcase for some version control tasks. I recently wrote a large module with a number of new files, and it was time to add it to source control. Clearcase’s GUI has no ‘recursively add all these files’ function, which is one of the many ways in which it strives to suck, and succeeds beyond expectations.

Fortunately, I’ve got Cygwin on my Windows box. First up: get a list of files to check in. I want only my module, and not any of the Frontpage crap that Visual Studio adds to web projects. So, I need a list of all the files in the project, then get rid of any of them that are not in my module’s folder, then get rid of any directories that start with an underscore (the frontpage crap), then save that list to a file.

find . | grep /MyModule | sed /\/_[a-z]/d > list.txt

(Yes, there are plenty of more efficient ways to write this, but it was the first way that came to mind, and it works.)

Now I need to take each of those items and check it in to ClearCase one by one. (Clearcase has an import commandline command that would take them all at once, but I don’t have permission to run it in my environment). No sweat with bash.

for file in `cat list.txt`; do cleartool mkelem $file; done

Awesome. Two commands instead of an hour’s worth of clicking, saving me so much time that I waste it on things like posting to blogs while I wait for the checkin to finish.

You need Cygwin if you are a serious power user of any kind. Learning it will not only make you faster, it will make you more platform independent. Almost all non-Windows platforms that you run across use some variation of this syntax.


Comments

by rob,   December 9, 2004 11:40 AM  

I'm not sure what "don't have permission to use it in my environment" means wrt clearfsimport, but there is an option (-nsetevent) that allows a generic VOB user to import without having to be the VOB owner....



Add Comment


Want to advertise on this site? Contact FM.
Laser Toner Cartridges UK laser toner, toner cartridges, hp toner, lexmark toner, samsung toner, canon, toner, epson toner, oki toner, kyocera toner, xerox toner, remanufactured toner, compatible toner
Direct TV Deals Free 4 room direct tv deals. no equipment to buy. free fast professional direct tv installation. this is the best direct tv deal available anywhere.
SEO Article Learn from the experts with our SEO article.
rope light Shopping with birddog distributing, inc., gives you access to the lowest prices, the best customer service and the quickest delivery times possible.
Laptop AC Adapter We offer genuine factory direct replacement AC adapters.
Direct TV Best satellite TV deals.
Direct TV Deals Direct TV programming deals are varied and include packages containing from 50 channels up to over 250 channels.
8mm film to DVD Retain family memories with the only frame by frame digital restoration service in the United States for your 8mm film to DVD today
Rubber Stamp Shop for custom self-inking stamps, hand stamps, address stamps, label stamps, check endorsement stamps, check deposit stamps, date stamps, pre inks, pocket stamps, ink and much more!