copying files

Randal Schwartz merlyn at iwarp.intel.com
Sat Dec 8 05:05:24 AEST 1990


In article <1990Dec6.230153.14856 at wpi.WPI.EDU>, fenn at wpi (Brian Fennell) writes:
| In article <169 at raysnec.UUCP> shwake at raysnec.UUCP (Ray Shwake) writes:
| >rouben at math13.math.umbc.edu (Rouben Rostamian) writes:
| >
| >>In article <1990Dec5.021951.28104 at en.ecn.purdue.edu> nichols at 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) 
| >>|
| >
| >>Try
| >>	ls -d .*
| >
| >	For some users on some systems, this will list both current directory
| >(.) and parent directory (..), which is not what is required. Try instead:
| >
| >	ls -d .??*
| 
| ls -dal `ls -da .* | grep -v '^\.$' | grep -v '^\.\.$' `
| 
| sheeeeeesh

OK, I'll take that as a challenge.  Here it is in one less process,
and *without* the shell globbing getting in the way:

ls -dl `ls -a | egrep -v '^([^.].*|\.\.?)$'`

(Don't have the shell see a wildcard unless you want the shell to glob it.)

Just another Unix hacker,
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/



More information about the Comp.unix.shell mailing list