2007-07-13

Command line: do you still use it?

Well, I do and for quite some years I've been using JPSoft's 4NT. I have some nice batch files, custom prompts, custom functions and it has a whole lot of built-in commands, variables and functions as well.

But, not only do I find myself doing less actual command line stuff, I sometimes get a bit mad at this product, like yesterday when I was attempting to use drive aliases inside a function and later found out that it doesn't work there, only in commands... Kind of the legacy from a program that, the author has admitted, has a ton of different parsers for a ton of different functions/commands. It's also partly due to the fact of maintaining compatibility with command.com and cmd.exe in their many versions and changes so far, but sometimes I think that it would be better to use something else for my command line scripting, perhaps something that doesn't carry this legacy compat baggage and thus can have a more uniform and predictable syntax.

Which brings me to the question: do you still do comand line? What tools/programs do you use for it? Or do you rely on good old fashioned cmd.exe for your command line work?

I've once tried to use PowerShell from MSFT, but, not only did it still have a lot of rough edges (like, for instance, not being able to easily work on files with some valid dos file name characters!), and, even though it is a very considerable change from cmd.exe, and sure looks powerful, it wasn't that much better than cmd.exe and even a bit lacking in many basic functions, at least a couple years ago when I tested it!

So, if you have a nice experience with something other than 4NT/CMD/COMMAND, let me know what you use and how happy you're about it and I may even go and try that for a change!

11 comments:

Anonymous said...

I give up to use it, now I use a Xml File parser built with Deplhi, where I add the commands that I need to execute. Like this, I can add any commands I need, any time I want, intrepreted by language that I know better (Delphi).

Anonymous said...

xbSure, still use command prompt (cmd.exe) for batch operations.

Chava GR said...

I've heard some comments about using Cygwin (a windows port of gnu tools), I haven't used yet, I like unix bash from linux a lot and I'm very comfortable on it, when using cmd.exe I feel as if I were lost my thumbs, but I still prefer command-line to GUI in 70% times.

I will start testing Cygwin and I comment out later.

P.D. The Xml Parser sounds like a great idea.

Unknown said...

Are you asking about the command line... or are you asking about batch files? 4NT extensions or not, the frustrations you describe sound a lot like normal batch-file headaches. And it sounds like you're saying batch files are not the right tool for the jobs you're trying to put them to.

If batch files aren't capable enough, then find a good tutorial on a scripting language. I prefer Ruby, because it's OO, has relatively clean syntax, and gives you a lot of power out of the box. But there's also Perl and Python, among many others.

Fernando Madruga said...

Command line and batch files! ;)

I have a few batch files for mundane tasks but mostly I have a small amount of 4NT aliases for doing many things that I find myself doing faster in the command line rather than launching some specific UI for that task, be that start/stop services, changing file attributes and/or copying/moving/backing up files, searching for files, cleaning up temporary files (at this point, the word FILES starts to stand out a bit!)

Looks like I really ought to look for a nicer file manager! :)

I've done some perl programming but for many quick tasks, perl's cryptic syntax means that, by the time you need to do something different you need to think a bit about it and even debug a bit because it was some months since you last used it and perl syntax is a bit Cish in that it is a bit forgiving but allows you to easily shoot yourself in the foot! :) So, for some particular, one-of event, I found perl to be too "heavy", not in runtime but in script creation time...

Maybe I ought to take a look at ruby or python instead...

Anonymous said...

I love my command line, try and take it away at your peril.

Anonymous said...

Fernando

Have you tried writing plugins for 4NT ?

Can you give a more detailed example of the problems you are describing?


thanks

Fernando Madruga said...

Anon: I did try writing some plug-ins and they even sort of worked, although that was also when I realized that there was no unified parsing routing and I'd have to add my own to the already tens of different parsing routines.

I mean, don't get me wrong: 4NT is still one of my favorite tools and something I keep on my USB memory stick! But sometimes it really annoys me to hell that they strive so hard to maintain compatibility with a defunct command processor (read: several different versions of that, each one with their own set of emulated bugs!), that sometimes things are not as clear as you'd expect. Syntax varies widely.

My latest gripe was what I described in this post and it was "one more drop". It's a fine tool and I haven't found something better yet (also, haven't been looking hard TBH!), but sometimes I'd rather have to learn something new with a more predictable syntax than having to fight some oddities in a command processor that has to emulate tens of different versions of command.com/cmd.exe and all their bugs...

Trevor Dunsford said...

console2. open source on sourceforge. As i understand it, its just running a hidden command.com and putting a nice front end on it. But you get tabs, colors, fonts, transparency (if you like that kind of stuff) and you can set it up so you can actually use CTRL-V to paste without having to right-click on the header and choose paste.

Fernando Madruga said...

Thks for the suggestion but looks more basic than what I need! ;)

As for ^V in CMD, you can almost get that: just right-click anywhere and select Paste or activate Quick Edit mode in the properties and then right-click does a paste instead of popping up a menu. (Copy is drag with left mouse button and press enter).

Anonymous said...

This might just be me talking to an empty room, but I still use 4NT (and Take Command) for the real dirty jobs.

There are just too many things you CAN do with 4NT that are not only absolutely impossible to do with any kind of drag/drop GUI, they do it faster as well! Try copying 10,000+ music files through a batch conversion btm script that not parses the names on the fly!

It's not impossible to develop a gui application that does the same thing, don't get me wrong - but how much time would you spend in Delphi/perl/ruby/php to pick apart filename constructs that you can do with a tool like 4NT?

And I've just finished initial development of a Delphi app that provides file-management functions on any CP/M system. I think I must be getting old.