Date: Sat, 3 Aug 2002 00:06:20 +0200 From: Roman Neuhauser <neuhauser@bellavista.cz> To: Dan Nelson <dnelson@allantgroup.com> Cc: Pascal Giannakakis <capm@gmx.net>, freebsd-questions@FreeBSD.ORG Subject: Re: smart file gobbling: exclude one file from list Message-ID: <20020802220620.GN52563@freepuppy.bellavista.cz> In-Reply-To: <20020802215617.GA9408@dan.emsphone.com> References: <001201c23a6e$17e78e60$0200a8c0@capm> <20020802215617.GA9408@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Fri, 2 Aug 2002 16:56:17 -0500
> From: Dan Nelson <dnelson@allantgroup.com>
> To: Pascal Giannakakis <capm@gmx.net>
> Cc: freebsd-questions@FreeBSD.ORG
> Subject: Re: smart file gobbling: exclude one file from list
>
> 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
this is somewhat easier:
cp $(echo `ls|grep -xv notme`) /destination
--
FreeBSD 4.6-STABLE
12:05AM up 3 days, 7:41, 10 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020802220620.GN52563>
