Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re: Idiom for $(ls -d $pattern 2>/dev/null) Message-ID: <2189@solo11.cs.vu.nl> Date: 21 Mar 89 03:26:22 GMT References: <21939@shemp.CS.UCLA.EDU> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 22 das@lanai.cs.ucla.edu writes: \Do you have a favorite idiom for (ksh syntax): \ for f in * \(Which is not what you really want, since if the directory is empty, f takes on \the value "*"). set - ` for i in .* * do echo "$i" done | sed -e '/^\.$/d' -e '/^\.\.$/d' ` [ -f "$1" ] && { for i do echo "$i" done } -- Modeless editors and strong typing: |Maarten Litmaath @ VU Amsterdam: both for people with weak memories. |maart@cs.vu.nl, mcvax!botter!maart