From owner-freebsd-questions Fri Aug 2 14:56:22 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 25D2137B401 for ; Fri, 2 Aug 2002 14:56:19 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76D5943E6E for ; Fri, 2 Aug 2002 14:56:18 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g72LuH9T042516; Fri, 2 Aug 2002 16:56:17 -0500 (CDT) (envelope-from dan) Date: Fri, 2 Aug 2002 16:56:17 -0500 From: Dan Nelson To: Pascal Giannakakis Cc: freebsd-questions@FreeBSD.ORG Subject: Re: smart file gobbling: exclude one file from list Message-ID: <20020802215617.GA9408@dan.emsphone.com> References: <001201c23a6e$17e78e60$0200a8c0@capm> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001201c23a6e$17e78e60$0200a8c0@capm> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error 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 In the last episode (Aug 02), Pascal Giannakakis said: > Hi, > > 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 -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message