From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb0e,cdca3dc8d6167cd4 X-Google-Attributes: gidfdb0e,public X-Google-Thread: f7344,a808e23c428d1184 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,cdca3dc8d6167cd4 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2002-01-07 12:56:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!iquest!news1.iquest.net!not-for-mail From: "JD" Newsgroups: comp.os.vms,alt.sys.pdp10,comp.sys.dec References: <3roT7.207043$tf5.13617499@bin5.nnrp.aus1.giganews.com> <3C338089.1C12E6FA@trailing-edge.com> Subject: Re: historical evidence of what went wrong at DEC MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Mon, 7 Jan 2002 16:01:47 -0500 NNTP-Posting-Host: 198.70.149.90 X-Complaints-To: news-abuse@iquest.net X-Trace: news1.iquest.net 1010436876 198.70.149.90 (Mon, 07 Jan 2002 15:54:36 EST) NNTP-Posting-Date: Mon, 07 Jan 2002 15:54:36 EST Xref: archiver1.google.com comp.os.vms:58884 alt.sys.pdp10:9241 comp.sys.dec:11155 "JD" wrote in message news:URl_7.1146$Pe5.195345@news1.iquest.net... > > "Bob Koehler" wrote in message news:dye7SH1FJ3w3@eisner.encompasserve.org... > > In article , "JD" writes: > > > > > Take a look at other posts in this thread. There is a trick that you > > > can prefix a name with a character or somesuch. You also have to > > > make sure that the 'quotes' propagate correctly. > > > > > > > > For example, a filename like 'a a.c b' needs to have the quotes > > > managed correctly. I just did a test like the following: > > > > > > cp foo 'f o.x x' > > > or > > > cp foo "f o.x x" > > > > Using my script, all the following fail to pass properly to the cp > > command: > > > Okay, I didn't realize that your question wasn't rhetorical!!! I PROMISE to > look at the problem in a few hours (hopefully before 20:00 EST.) > It looks like Peter da Silva has already done it. If you look carefully at what he did: note that the names are stored into a variable, and the careful use of the double quote. (Thanks Peter!!!) One thing that one should remember: the shell will tend to split names into an arg list. This is true even for variables when they are expanded. An easy way to subvert that default behavior is to add a double quote around a shell variable reference. The single quote will likely screw you in this case, because it will inhibit expansion. The major mistake in your script was the missing 'double quotes.' Without those, the shell will expand the variables and try to split the variables into arguments. I am NOT a sysadmin or shell expert, but do kernel things. If someone couldn't fix the problem unless they wrote shell scripts every day, then there might be a reason for complaint. Fortunately, or unfortunately, the shell very consistantly splits arguments, the double quote mechanism is a VERY USEFUL tool. Another hint: don't store double quotes into a shell variable unless there is a serious reason for it. I suspect that things would be tricky in some cases, if a filename contains a quoting character, but that is yet another problem. :-). John