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 10:19:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!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 13:25:03 -0500 NNTP-Posting-Host: 198.70.149.90 X-Complaints-To: news-abuse@iquest.net X-Trace: news1.iquest.net 1010427470 198.70.149.90 (Mon, 07 Jan 2002 13:17:50 EST) NNTP-Posting-Date: Mon, 07 Jan 2002 13:17:50 EST Xref: archiver1.google.com comp.os.vms:58806 alt.sys.pdp10:9216 comp.sys.dec:11127 "Bob Koehler" wrote in message news:QFaxgika9mio@eisner.encompasserve.org... > In article , "JD" writes: > > > > "Bob Koehler" wrote in message news:Fs8N42DvlVjf@eisner.encompasserve.org... > >> In article , rivie@cougar.no.domain writes: > >> > >> > I'm probably simply dense, but I've never found a reasonable way of > >> > dealing with filenames that have spaces in Unix. Just when I think I've > >> > got it figured out, something will break. > >> > >> Same here, I've got several ksh scripts that take file name > >> parameters, but no matter how much I quote the original I can't > >> get past the spaces in all my Mac folder names. > >> > > Hmmm... I haven't run into a situation that I couldn't handle like that... > > Then maybe you know something I don't. I've got this little ksh > function which emulates some features of DCL copy that the shell > won't do for me on one line. But I can't "copy a\ a.c b", and > I've tried all kinds of escape and quotes with the file name a\ a.c > 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" For constant values, these quotes are the same. For shell variables, the results would be different. and the filename was correctly created. When scripting, it is important to quote, and sometimes to use shell variables to contain filenames. When storing a filename into a shell variable, make sure that there is a controlled number of quotes (most often, none.) When using a shell variable, use the appropriate quoting for the entire name, or use the appropriate scheme for slicing off the portion of the name that you are interested in. When doing comparisons, there are also some methods as shown in other postings on this thread. In ksh (or other normal shells), the difference between '', "" and other kinds of quoting need to be well understood. John