copying files

Don Christensen djc at Kesa.COM
Sat Dec 8 07:17:27 AEST 1990


chris at mimsy.umd.edu (Chris Torek) writes:

>>In article <1990Dec5.021951.28104 at en.ecn.purdue.edu>
> nichols at en.ecn.purdue.edu (Scott P Nichols) asks how to match `.*' without
> matching . and .. (in essence, anyway).

>In article <EMV.90Dec5104011 at crane.aa.ox.com> emv at ox.com (Ed Vielmetti) writes:
>>I usually use .??*, which works unless you have a file like ".a" or
>>".Z". 

>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).

I typically use .??* because it is the easiest to type and I have rarely
(never?) come across a two character `.' file.  It seems to me, though,
that the shortest way to get all `.' files excluding `.' and `..' is
with the following expression:

ls -d .[^.]*


Don
-- 
Don Christensen  <=> djc at kesa.com     <=> "Ashes and diamonds, foe and friend;
Kesa Corporation <=> ...!mips!kesa!djc <=> they are all equal in the end."
Santa Clara, CA  <=> ...!daver!kesa!djc <=>                      -- Pink Floyd



More information about the Comp.unix.shell mailing list