Path: utzoo!attcan!uunet!wuarchive!usc!elroy.jpl.nasa.gov!mahendo!nereid!john From: john@nereid.jpl.nasa.gov (John Veregge) Newsgroups: comp.unix.shell Subject: Re: copying files Keywords: cp Message-ID: <4914@mahendo.Jpl.Nasa.Gov> Date: 10 Dec 90 19:59:21 GMT References: <1990Dec5.021951.28104@en.ecn.purdue.edu> <4615@umbc3.UMBC.EDU> <1990Dec6.230153.14856@wpi.WPI.EDU> <24@kaspar.UUCP> Sender: news@mahendo.Jpl.Nasa.Gov Reply-To: john@nereid.jpl.nasa.gov (John Veregge) Organization: Technology Development Group (JPL) Lines: 63 In article <24@kaspar.UUCP>, ires@kaspar.UUCP (Bruce R. Larson) writes: |> In article <1990Dec6.230153.14856@wpi.WPI.EDU>, fenn@wpi.WPI.EDU (Brian Fennell) writes: |> > In article <169@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes: |> > >rouben@math13.math.umbc.edu (Rouben Rostamian) writes: |> > > |> > >>In article <1990Dec5.021951.28104@en.ecn.purdue.edu> nichols@en.ecn.purdue.edu (Scott P Nichols) writes: |> > >>| |> > >>|Do any of you UNIX wizards know how to even list all of |> > >>|the names of the files which begin '.' (besides, of course |> > >>|the files in the root (second line of list) |> > >>| |> > |> > ls -dal `ls -da .* | grep -v '^\.$' | grep -v '^\.\.$' ` |> > |> > sheeeeeesh |> |> Are you guys still talking about this? Sheeeesh indeed! |> |> Sorry Brian, but did you try your solution? It lists both `.' and `..'. |> |> |> |> The fellow who suggested `ls -ld .*' gave the best non-pipe solution to date. |> You can get rid of the `.' entry by listing filenames with at least 2 chars. |> |> ls -ld .?* |> |> The only undesirable entry remaining is `..'. |> |> |> If you absolutely *have* to get rid of the `..' you can do this: |> |> /bin/ls -ld .?* | grep -v ' \.\.$' |> |> [NOTE: Use /bin/ls or equivalent to avoid aliased ls's and locally |> modified ls's.] |> |> If we don't put this one rest soon we'll start getting awk and perl and |> who-knows-what-else solutions. |> |> B I have found the following work quite well ... (But alas, I never tried them on anything but our Suns.) sh: echo .[!.]* OR ls -ad .[!.]* csh: echo .[\ --/-~]* OR ls -ad .[\ --/-~]* The bourne shell allows an enclosed pattern specification of "any character but these" with [! ... ]. The c shell apparently does not (and I looked real hard {-:). The c shell enclosed pattern specification is "any character from the space (escaped) character to the minus sign character OR from the slash character to the tilde character." The specification is missing only one ascii printing character, the period character. -- John R Veregge Section 348 - Flight Command and Data Jet Propulsion Laboratory Management (Technology Development) Calif Institute of Technology Mail stop: T1704, Office: T1704-P 4800 Oak Grove Drive Phone: (818) 354-0511, FAX: 393-4494 Pasadena, CA, USA 91109 john@triton.jpl.nasa.gov