• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Downsizing in-camera and out

Doug Kerr

Well-known member
On the Pig Latin of programming languages

One effect of our reintroduction to Bart's wondrous "batch file" for image resizing with ImageMagick (you'll see in a minute why I put that in quotes) is that I have had to revive and bring up-to-date my understanding of the syntax of (to use its proper name) the Microsoft command line script language, which I think of as the Pig Latin of programming languages.

Of course the presenting interest is my making modifications of Bart's file to give a file that will automatically do my most common resizing tasks without requiring input from me, and follow my conventions for the naming of modified files. (Working fine, bu the way.)

Now we often hear of this language as the "batch file" language, and of script files written in it as "batch files'. In fact that name is given credence by the filetype extension of the script files, "BAT".

This comes about because one of the early uses of such script files, especially in DOS days, was to mechanize the performance of two or more operations (perhaps from such possibilities as "copy", "rename", and "delete") upon several files - a "batch".

But in fact most uses of this script language have been for files that do no such thing, but rather give a string of commands (perhaps complex) to a "command-line driven" program that may have nothing to do with files, or which may have implications only on a single file.

Bart's script file is, in its present state, in no sense a "batch file" (although I know there are aspirations for it to perhaps become such).

For those not familiar with this language, I can give some sense of its horror by discussing the keyword "ECHO".

• When followed by "on" or "off", it turns on or off the feature in which a command read from the script file is sent to the screen. By the way, when echoing is off, the command prompt itself is now longer presented on the screen.

• When used alone, it causes a report to be sent to the screen as to whether echoing is on or off.

• When followed by a string (other than "on" or "off"!), it sends that string to the screen.

Now, when we start, echoing is on. We may want to, as the first act of the script file, turn it off. So we make our first command "ECHO off".

But since echoing is not turned off until this command has been processed, it is echoed to the screen "on the way in", which we may find nikulturniy.

So we must make that first command "@ECHO off". The "@" means, "do not echo this command to the screen even if echoing is on."

Now it can be argued that there is a sort of perverse logic to this. Whatever.

Aren't you glad you asked.

Best regards,

Doug
 
Top