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.

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 *

That has the effect of creating an archive named -x. UNIX did not complain or 
warn about that at all. (It complained about some unnamed file not being found, 
presumably os390.) That is poor design IMHO.

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?"

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Paul Gilmartin
Sent: Wednesday, November 4, 2020 5:50 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: FSUM7197 pax: invalid archive format selected

On Wed, 4 Nov 2020 16:30:35 -0800, Charles Mills wrote:

>No, I was trying to archive the current directory, and it contained a file 
>named -x (created accidentally) and the next folder is named 'foldername' (per 
>my original post). 
>
>John is saying that the shell expands the folders recursively, so pax sees pax 
>blah blah -x foldername ...
>
>And says foldername is an invalid operand for -x.
>
>Comprende?
>
I understand; I'm merely astonished that pax uses shell filename expansion to
build a command line which is passed to pax as a list of individual filenames.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to