Re: An end to tweaking?

From: Chris Barts (chbarts_at_gmail.com)
Date: 07/12/05


Date: Mon, 11 Jul 2005 16:12:37 -0600

On Mon, 11 Jul 2005 09:01:52 -0700, comp.os.spil wrote:

>
> I used to write batch files under DOS. I even had Neil Rubenking's
> Batch File Lab Notes, which had so much info it boggled my mind. The
> original batch language was *very* sparse, but he got it to count four
> digits with recursive algorithms and make the screen sprout legs and
> tap dance with ansi.sys commands and debug scripts.

Doing /anything/ recursive with DOS batch makes my head hurt. ;) It was a
very, very sparse language indeed, and perhaps the best that could be said
about it is that going from DOS batch to VMS is easier than going from the
average Unix shell to VMS.

But who needs to move to VMS these days?

>
> Fast forward to today and we have a guy named "tab" complaining about
> "endless" tweaking. Shirley, there must be an end to tweaking
> somewhere.
>
> (1) Once you have written the shell script (I assume it's the
> equivalent to batch processing, I hope it's better) you should just
> start *using* the computer. The Matrix thread from a couple of weeks
> ago suggested you can load drivers, thunks, and needed utitilies to run
> an app, then unload them when it's finished so you can run another app.
> All without rebooting.

True. And yes, bash (the default shell under Linux) is /much/ better than
DOS batch. For example:

# Mass-convert all .gif files in the current directory to .png files.

for i in *.gif # Iterate over all files that end in .gif.
do
  n=`basename $i .gif` # Remove the extension.
  giftopnm $i | pnmtopng > $n.png # Do the conversion with pipes.
done

You can save that to a file and it will be a first-class command from then
on. You don't need to care that it's written in shell instead of C or Perl
or COBOL. You can write it all out on the command-line, too, if you don't
expect you'll ever need to mass-convert .gifs to .pngs again.

(Pardon me if I ramble for a while. I don't know if DOS batch had
pipes.)

That last command bears some extra commentary: It is actually two
programs, one feeding data to the other without needing to create a
temporary file on disk. Piping information around is a huge advantage of
the Unix command line environment.

>
> (2) One thing I don't like about Linux is the Unix command names. I'm
> guessing this is part of that learning curve I've heard so much about.
> DOS command names were easier to memorize. Now, I can call a shell
> script anything I want, just like the old DOS batch files, right? I'm
> guessing this is what the rest of you are doing.

The names come with time. You can create aliases and hide them behind
obfuscation, but in the long run it's better to learn the actual commands.

And you can indeed call a shell script anything you want. That is
certainly what I am doing, at any rate.

>
> So what I want is to tweak when I change something, then just go. Is
> that posible with Linux? With any distro? With any shell?

Yes, yes, and yes. :)

(Some shells are better than others, but a discussion of that inevitably
ends in flamewar. I personally like zsh, others swear by ksh, and some
think bash is best. A few prefer tcsh, but the tcsh programming language
is completely different from what I've shown you.)

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



Relevant Pages

  • Re: Multi-zip files -- Windows server
    ... native DOS versions). ... TO BATCH OR NOT TO BATCH ... and using a batch file to try and solve the problem... ... The IBM PC operating system command line is a most ...
    (comp.sys.cbm)
  • Re: Shell to Command
    ... > I have a VB6 program that shells to the dos prompt then opens an ftp ... > manually start a dos session and type in the command line ftp, ... Am I missing something in the shell function? ...
    (microsoft.public.vb.syntax)
  • Re: Run Items Without Explorer
    ... I call this a batch shell. ... Startup a batch command as Shell and at the end of the batch file, ... The standard RUN key in the registry will help you. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Shell function - accessing an Access secure db (.MDW file)
    ... > Hi - Does anyone know the correct syntax for the shell function. ... You can use the Shell command. ... To execute internal DOS command (Dir, Copy, ... Private Declare Function OpenProcess _ ...
    (microsoft.public.vb.general.discussion)
  • Re: useing paramters with shell
    ... regarding the Shell command. ... You can use the Shell command. ... To execute internal DOS command (Dir, ... Specifying the command processor is safe & generic and ...
    (microsoft.public.vb.general.discussion)