https://opensource.com/business/14/12/linux-philosophy
On Thu, 5 Nov 2020 06:46:15 -0800, Charles Mills wrote:
>What the heck were the UNIX designers thinking when they allowed the casual
>creation of a filename of -x? There may be a legitimate reason why someone
>would want to create a file named -x but if so, then *they* should be made to
>jump through some small hoop and "escape" the name in some way. The innocent
>victim who stumbles into this situation should not be the one made to jump
>through hoops. Will UNIX allow the creation of a file named "rm *"? That could
>have some interesting side effects.
>
Even worse, a file named "-rf *".
This resembles the plaint of a JCL novice who has just encountered, painfully,
the astonishing behavior of:
//SYSUT1 DD DSN=&SYSUID..PDS(MEMBER),DISP=(OLD,DELETE)
That should be fixed for DYNALLOC, JCL, TSO, globally by making the
TU for member mutex with the TU for delete. Who volunteers to bell
the RFE cat?
Probably there's a "dusty deck" somewhere whose inexcusably clever
author relied on the behavior and whose heirs haven't access to the
source.
>How did I inadvertently create a file named -x? I had a pax command
>
>pax -wzvf /my/archive.pax *
>
>I had an error that I thought might be solved by -x os390. Looking at the
>above command I forgot that /my/archive.pax "went with" the -f and coded
>
>pax -wzvf -x os390 /my/archive.pax *
> ...
>Heck, if the shell is going to expand the * then it could generate a warning
>"hey, did you know that one of your files has a name that looks just like a
>switch?"
>
Shell doesn't know what's a file and what's a switch. That's the
responsibility of the utility, even as JCL shouldn't know what PARM means:
//STEP EXEC PGM=BPXBATCH,PARM='sudo rm -rf /'
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN