[Info-vax] Long uptime cut short by Hurricane Sandy

Johnny Billquist bqt at softjar.se
Thu Jan 31 16:34:10 EST 2013


On 2013-01-31 19:05, Simon Clubley wrote:
> On 2013-01-31, VAXman-  @SendSpamHere.ORG <VAXman- at SendSpamHere.ORG> wrote:
>> In article <kedtde$9tr$1 at dont-email.me>, Stephen Hoffman <seaohveh at hoffmanlabs.invalid> writes:
>>>
>>> The OpenVMS command line, system services, the language and run-time
>>> libraries and the rest are similarly limited.  Solid, but limited.
>>>
>>> While it's possible to do a whole lot with VMS — "Turing Complete" and
>>> all — it's increasingly involving far more work and far more time and
>>> far more effort.  Adding all this code means there's more to go wrong,
>>> too; when you need a few hundred or a few thousand lines of glue code
>>> and a {collective noun} of DCL procedures, you're adding bugs and costs.
>>>
>>> In terms of raw command line features and capabilities, bash completely
>>> blows the sneakers off of DCL.  It's possible to do a whole lot more in
>>> bash, and often in a whole lot less space.  Not that there aren't
>>> gnarly parts of bash, not to imply bash is the paragon of clear syntax,
>>> and not to imply bash makes a good newsreader.  (Though it would not
>>> surprise me to learn somebody's written a newsreader in bash, either.)
>>>
>>> Put another way, when working in DCL, I find myself missing various
>>> capabilities of bash.  Yes, you can get there.  But as Simon writes,
>>> the DCL code is more cluttered and more convoluted.  Which is just a
>>> little weird, given how convoluted and cluttered bash can and often
>>> does look.  I find myself climbing into gnv for various tasks, too.
>>
>> Show me... without PIPES and myriad other *IX utilities.  Compare only
>> /bin/bash scripting semantics with DCL's.
>>
>
> Hoff has shown you some examples, but I am going to take a different
> approach and show some really simple examples which any DCL user should
> be able to follow and appreciate.
>
> BTW, those Unix utilities are as much a part of the shell environment on
> Unix as the equivalents are a part of DCL. For example, neither environment
> has a built in command to delete files; it's a external command involved
> by the shell.
>
> Some simple examples:
>
> Instead of having to use a f$search based loop, you can iterate over a list
> of files with a simple for statement and use the filename in a list of
> commands to be executed. Furthermore, the list of files is immutable while
> the commands are running so you don't have to worry about the context
> been destroyed by your commands.
>
> You can eliminate a good amount of filtering code by using a regex to much
> more accurately identify the files you are looking for.
>
> bash has _real_ arrays: http://tldp.org/LDP/abs/html/arrays.html
>
> On Unix, the command to delete a tree really does what it says on the tin.
>
> rename is far more powerful; you can specify a part of a filename to be
> replaced with another string and apply this to a set of files.
>
> When searching the _contents_ of files to find matching files, you can also
> eliminate a good amount of code by using a regex to much more accurately
> identify the files in the first place.
>
> You can easily keep two file trees in sync, including deleting stale files
> from the target tree, by using rsync. You can even do this with trees
> located on different machines by running rsync over a ssh transport.
>
> These are just some simple examples which every DCL user will have come
> across during normal use; I certainly have. You can do all of the above
> using DCL, but you have to use ugly hacks or a lot more code to achieve
> the same thing.

While I agree with many things you write here, one is very different in 
my mind.
Renames...

 > rename is far more powerful; you can specify a part of a filename to be
 > replaced with another string and apply this to a set of files.

Really? How? mv in unix has more than its fair share of brain damage. It 
can essentially work in two modes:
1 - Given two arguments and the second not being a directory, it renames 
the first argument to the second, unless the second already exists. It 
does not do any kind of pattern matching, replacing, or anything at all.
2 - Given atleast two arguments, where the last argument is a directory, 
it will move all the n-1 arguments into the last argument, being a 
directory. No renaming of the files as such at all happens.

One very obvious thing it cannot do, which is not unheard of in DCL is 
just simply renaming a bunch of files, such as (in DCL):

RENAME *.FOO *.BAR

mv just cannot do this. And shell globbing will not help you either. 
You'll have to write a loop with a rather elaborate scheme to implement 
this rather simple thing.

So, what are you thinking about in your comment? What have I totally missed?

(And by the way, wildcard handling in Unix has its ups and downs. I'm 
not overly impressed by it, but it's a workaround that sometimes is 
useful, except of course every program have to implement this itself if 
it wants to be able to deal with wildcards. No common library for that 
stuff.)

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol



More information about the Info-vax mailing list