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: 1164f8,cdca3dc8d6167cd4 X-Google-Attributes: gid1164f8,public X-Google-Thread: f7344,a808e23c428d1184 X-Google-Attributes: gidf7344,public X-Google-ArrivalTime: 2002-01-07 11:18:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed1.cidera.com!Cidera!portc03.blue.aol.com!news-east.rr.com!news01.optonline.net!news02.optonline.net.POSTED!not-for-mail From: Arthur Krewat Newsgroups: comp.os.vms,alt.sys.pdp10,comp.sys.dec Subject: Re: historical evidence of what went wrong at DEC Organization: Kilonet.net Message-ID: <3C39F2ED.DD935983@bartek.dontspamme.net> References: <3roT7.207043$tf5.13617499@bin5.nnrp.aus1.giganews.com> <3C338089.1C12E6FA@trailing-edge.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.78 [en] (X11; U; SunOS 5.8 i86pc) X-Accept-Language: en Date: Mon, 07 Jan 2002 19:13:04 GMT NNTP-Posting-Host: 24.186.100.134 X-Trace: news02.optonline.net 1010430784 24.186.100.134 (Mon, 07 Jan 2002 14:13:04 EST) NNTP-Posting-Date: Mon, 07 Jan 2002 14:13:04 EST Xref: archiver1.google.com comp.os.vms:58834 alt.sys.pdp10:9227 comp.sys.dec:11139 Bob Koehler wrote: > > 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 > The following works w/Solaris but should work on any system with bourne shell. Note the double quotes and the use of $NF w/awk to pick off the LAST field to get the extension - this allows dots in the file name too (YMMV - unspecified behavior if an extension is not on the source file). i=`echo "$1" | awk -F. '{print $NF}'` j=`echo "$2" | awk -F. '{print $2}'` k=`echo "$2" | awk -F. '{print $1}'` if [ "$j" = "" ] then to=$k.$i else to="$2" fi cp "$1" "$to" This was tested with the command "sh a.sh a\ a.c b.c" and it copied a file named "a a.c" to "b.c" aak