Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!wuarchive!udel!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.shell Subject: Re: copying files Message-ID: <28360@mimsy.umd.edu> Date: 6 Dec 90 16:53:38 GMT References: <1990Dec3.215656.8961@en.ecn.purdue.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 37 >In article <1990Dec5.021951.28104@en.ecn.purdue.edu> nichols@en.ecn.purdue.edu (Scott P Nichols) asks how to match `.*' without matching . and .. (in essence, anyway). In various articles various people give incorrect and/or incomplete answers. One of the best answers is: In article emv@ox.com (Ed Vielmetti) writes: >I usually use .??*, which works unless you have a file like ".a" or >".Z". This is correct. `.??*' matches all files where: - the name begins with `.', and - the name contains at least three characters Since there is only one file that has one character and begins with `.', namely `.', all that is left are the two-character files whose name begins with `.'. You want all but `..'. If any such files exist, the pattern .[^A--/-^?] will match them. Note: ^A here represents a literal control-A, and ^? represents either a literal DEL (if you have only 7-bit shells and files) or meta-DEL (if you have 8-bit shells and files). Since it is generally not desirable to pass the pattern on if no files match (as is normal under sh and occurs when you `set nonomatch' in csh), you should use .[^A--/-^?] .??* only if you do have two-character-name `.' files. Alternative solutions using `ls -A' or `ls -a' and/or sed and so forth are available. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris