From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1044c2,fb87ccfc9e8baf0a X-Google-Attributes: gid1044c2,public X-Google-Thread: 1103af,fb87ccfc9e8baf0a X-Google-Attributes: gid1103af,public X-Google-Thread: f66ab,fb87ccfc9e8baf0a X-Google-Attributes: gidf66ab,public X-Google-Thread: f678f,fb87ccfc9e8baf0a X-Google-Attributes: gidf678f,public X-Google-Thread: f71eb,fb87ccfc9e8baf0a X-Google-Attributes: gidf71eb,public X-Google-ArrivalTime: 1995-01-07 15:48:54 PST Newsgroups: comp.os.linux.misc,comp.os.os2.misc,comp.unix.osf.misc,comp.os.msdos.misc,comp.os.mach Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!pipex!uunet!ljubljana.prpa.philips.com!ross From: ross@prpa.philips.com (Ross Morley) Subject: Re: The big Question Message-ID: <1995Jan7.234854.13800@prpa.philips.com> Organization: Philips Research Palo Alto References: <1995Jan2.135536.27035@imec.be> <1995Jan4.051639.24693@prpa.philips.com> <8j2gPm2SMUF=81pmpJ@transarc.com> <3egdv1$rmp@kubds1.kub.nl> Date: Sat, 7 Jan 1995 23:48:54 GMT Xref: nntp.gmd.de comp.os.linux.misc:37758 comp.os.os2.misc:125850 comp.unix.osf.misc:2281 comp.os.msdos.misc:28569 comp.os.mach:3466 >In article <8j2gPm2SMUF=81pmpJ@transarc.com> Jim_Mann@transarc.com writes: >... >> >>On the other hand, because of this, I believe DOS will allow you to >>issue a command like: >> >> copy *.doc *.bak >> >>and have it do the right thing (copy a.doc to a.bak, b.doc to b.bak, >>and so forth). Because the shell handles expansion in UNIX, UNIX >>can't do this sort of thing. I have to respond to this, since I seem to have started it. In this example, the *s mean two completely different things. The first is a wildcard that matches the first part of any filename. The second is a metacharacter which is replaced by whatever the wildcard matched. This is inconsistent use of *, which is confusing. In DOS COMMAND.COM, * is used differently by different commands, so you just have to remember the idiosyncrasies of each. Now what if I want to copy all the C and assembler source files and associated h files and a few specials, but not the object files or executables, to another directory. copy *.c *.s *.h foo.txt bar.txt /some/dir This will not work in DOS. Instead I have to say copy *.c /some/dir copy *.s /some/dir copy *.h /some/dir copy foo.txt bar.txt /some/dir (or do I have to separate those too?) In UNIX csh one would write cp *.[hsc] {foo,bar}.txt /some/dir which shows off some more of the powerful wildcard features available in UNIX (csh in this case). Somebody else already posted how to rename the extensions in a wad of files. I use a simple script I wrote for it. One thing about UNIX, if you can't do something by a direct command, you can easily write a script. Scripts in DOS (batch files) are too limited to do much useful - eg. you couldn't write a batch file to do that). Ross -- Ross Morley .---. email: ross@prpa.philips.com Philips Research Palo Alto | ___\ Phone: (415) 354 0325 4005 Miranda Ave, Suite 175 \/ \ FAX: (415) 354 0309 Palo Alto, CA 94304, USA ^^