Re: of shell, find, and (g)xargs (Re: mass uninstall all ports?)

[ Available lists | Index of freebsd-stable | Month of Jul 2001 | Week of 16 Jul 2001 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Dima Dorfman <dima@unixfreak.org>
Date
16 Jul 2001 22:22:18
Subject
Re: of shell, find, and (g)xargs (Re: mass uninstall all ports?)
Message-ID
20010717052214.E58793E28@bazooka.unixfreak.org

Referenced by

[ Hide this part ]
parv <parv_@yahoo.com> writes:
> ...but since freebsd's xargs doesn't support anything like gnu xargs' '-i'

Yes it does. Here's an excerpt from xargs(1):

-J replstr
If this option is specified, xargs will use the data read from
standard input to replace the first occurrence of replstr instead
of appending that data after all other arguments. This option
will not effect how many arguments will be read from input (-n),
or the size of the command(s) xargs will generate (-s). The
option just moves where those arguments will be placed in the
command(s) that are executed. The replstr must show up as a dis-
tinct argument to xargs. It will not be recognized if, for
instance, it is in the middle of a quoted string. Furthermore,
only the first occurrence of the replstr will be replaced. For
example, the following command will copy the list of files and
directories which start with an uppercase letter in the current
directory to destdir:

/bin/ls -1d [A-Z]* | xargs -J [] cp -rp [] destdir

It's not compatible with -i, but it would've served your purpose.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message



Elapsed time: 0.111 seconds