From owner-freebsd-questions Fri Aug 2 17:59: 1 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EEF4337B400 for ; Fri, 2 Aug 2002 17:58:58 -0700 (PDT) Received: from mail.thundernet.cz (mail.thundernet.cz [62.77.87.114]) by mx1.FreeBSD.org (Postfix) with SMTP id 9613E43E6A for ; Fri, 2 Aug 2002 17:58:57 -0700 (PDT) (envelope-from neuhauser@bellavista.cz) Received: (qmail 26974 invoked from network); 3 Aug 2002 00:58:51 -0000 Received: from unknown (HELO freepuppy.bellavista.cz) (62.168.44.50) by mail.thundernet.cz with SMTP; 3 Aug 2002 00:58:51 -0000 Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id 9F0B636A; Sat, 3 Aug 2002 02:58:50 +0200 (CEST) Date: Sat, 3 Aug 2002 02:58:50 +0200 From: Roman Neuhauser To: freebsd-questions@FreeBSD.ORG Subject: Re: smart file gobbling: exclude one file from list Message-ID: <20020803005850.GR52563@freepuppy.bellavista.cz> Mail-Followup-To: freebsd-questions@FreeBSD.ORG References: <001201c23a6e$17e78e60$0200a8c0@capm> <20020802215617.GA9408@dan.emsphone.com> <20020802220620.GN52563@freepuppy.bellavista.cz> <20020803002236.GA4398@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020803002236.GA4398@dan.emsphone.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Date: Fri, 2 Aug 2002 19:22:36 -0500 > From: Dan Nelson > To: Pascal Giannakakis , freebsd-questions@FreeBSD.ORG > Subject: Re: smart file gobbling: exclude one file from list > > In the last episode (Aug 03), Roman Neuhauser said: > > > In the last episode (Aug 02), Pascal Giannakakis said: > > > > if i do "cp * /destination", all files in the current directory > > > > will be copied to /destination. What do i have to type, if i want > > > > to expand the '*' to all files, except of one? For example, if i > > > > wanted to exclude the file "notme" in the current directory? > > > > > > > > I know i could hack it with grep, but this fails as all files are > > > > on one line. I wonder how you gurus would solve this! :) > > > > > > If you are using zsh and have the EXTENDED_GLOB option set, > > > > > > cp *~notme /destination > > > > > > Otherwise, you'll need to do something like > > > > > > cp $(echo ' ' * ' ' | sed -e 's/ notme / /') /destination > > > > this is somewhat easier: > > > > cp $(echo `ls|grep -xv notme`) /destination > > Although I don't think either will handle files with spaces in them. mine doesn't. -- FreeBSD 4.6-STABLE 2:58AM up 3 days, 10:34, 8 users, load averages: 0.00, 0.00, 0.00 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message