From owner-freebsd-questions@FreeBSD.ORG Mon Jun 30 06:07:58 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B4197A2 for ; Mon, 30 Jun 2014 06:07:58 +0000 (UTC) Received: from p3plsmtpa06-03.prod.phx3.secureserver.net (p3plsmtpa06-03.prod.phx3.secureserver.net [173.201.192.104]) by mx1.freebsd.org (Postfix) with ESMTP id 16991208E for ; Mon, 30 Jun 2014 06:07:57 +0000 (UTC) Received: from ethic.thought.org ([209.180.213.209]) by p3plsmtpa06-03.prod.phx3.secureserver.net with id LW6K1o0084XeM0101W6KYl; Sun, 29 Jun 2014 23:06:20 -0700 Date: Sun, 29 Jun 2014 23:06:24 -0700 From: Gary Kline To: Gregory Orange Subject: Re: long string using find and "-exec ls -ls" to find part-of filename Message-ID: <20140630060624.GA21157@ethic.thought.org> References: <20140630045605.GA11147@ethic.thought.org> <53B0EFF2.80205@calorieking.com> <20140630052410.GA16901@ethic.thought.org> <53B0FA11.8020808@calorieking.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53B0FA11.8020808@calorieking.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 06:07:58 -0000 ===== Organization: Thought Unlimited. Public service Unix since 1986. Of_Interest: With 27++ years of service to the Unix community. On Mon, Jun 30, 2014 at 01:48:01PM +0800, Gregory Orange wrote: > On 30/06/14 13:24, Gary Kline wrote: > >On Mon, Jun 30, 2014 at 01:04:50PM +0800, Gregory Orange wrote: > >>How about this? > >>find . -name foo.tar -o -name foo.tgz -o -name foo.tar.gz|xargs ls -lsi > > yup. then WHY O WHY O WHY doesnt this work:: > > find . -name "foo.t*" |xargs ls -lsi > > work? is it only my memory [[delusional] that made me think that > > "foo.t*" expanded into your cmd string?? I thought the "*" > > expanded into what you have to save the hacker typing/keystrokes. > > Curiously your command line works for me on both an Ubuntu (sh, > bash) machine and a FreeBSD (sh, bash, csh, tcsh) machine. I would > have expected the shell to expand * to and cause find to return an > error, but it appears not. Perhaps it depends on the shell? It works > for me on the shells listed above. this is bloody bizzarre. the first//Only first time, your cmd worked. ive used zsh since 1989 when I ported it to my 80286. I Still use zsh. but as-is [zsh], it still only works the first time. even with O's parens, no diff. I'm gng to try typing bash[it] and see. WHY your oneliner worked once, not even all the gods in hhell know. just FWIW: 5436 find . -name "vbc.t*" -print exec `ls` {} \; 5437 cbin 5438 rgr find 5439 find . -name "vbc.t*" -print |xargs ls -l from 65mins ago, the abv, here on "tao" ive got ubuntu 14.04 here; freeebsd and backup on my server; and a 'ripoff' redhat on my used 2cpu [unsed] desktop. here, tao, is where I live and hack. -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix Twenty-seven years of service to the Unix community.