Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <5.1.0.14.2.20021114093629.029925f8@pop3.cris.com> X-Sender: rrschulz AT pop3 DOT cris DOT com Date: Thu, 14 Nov 2002 09:49:13 -0800 To: cygwin AT cygwin DOT com From: Randall R Schulz Subject: Re: problem with bash In-Reply-To: References: <20021114103412 DOT A36130 AT reliant DOT immure DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Hi, Igor, Well, if we're going to play "what's the most convoluted way you can think of to do something with a much simpler equivalent," then I should point out that you need to modify your suggestion thusly: find . -maxdepth 1 \( -name .\* -o -print \) |sed -e 's/^\.\///' |xargs ls -d First, unless you give the "-d" option to "ls," you'll get a listing of the contents of any directories whose names are output by "find." (Or is that what the original user wanted? Somehow I don't think so.) Second, the names "find" prints (and which "ls" will subsequently reproduce in its output) will have "./" as a prefix, so the "sed" command is needed to remove them. This would also be true if you used the default starting directory for "find" (i.e., if you omit the "." argument). Personally, plain old "ls" works well for me. God!... Is this all my 25 years of using Unix is worth? Randall Schulz Mountain View, CA USA At 09:29 2002-11-14, Igor Pechtchanski wrote: >Well, if you really want something equivalent to 'ls *', you'd need to do >something like > >find . -maxdepth 1 \( -name .\* -o -print \) | xargs ls > >The "-maxdepth 1" is to not descend recursively into directories, and the >"-name .\*" is to avoid listing hidden files/directories (which would not >be matched by the '*' glob). The "-type f" is actually wrong, as '*' will >match directories as well. > >Also beware that ls may be an alias, and xargs will run the actual >executable in the path... > Igor -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/