Date: Mon, 25 Nov 2002 19:51:11 -0800 From: Nathan Kinkade <nkinkade@dsl-only.net> To: freebsd-questions@freebsd.org Subject: Re: xargs -J Message-ID: <20021126035111.GB14336@sub21-156.member.dsl-only.net> In-Reply-To: <20021125221003.A19207@sylvester.dsj.net> References: <20021125221003.A19207@sylvester.dsj.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 25, 2002 at 10:10:03PM -0500, David S. Jackson wrote:
> Hi,
>
> I've been trying to use |xargs -J [] mv [] [].suffix
>
> but to no avail.
>
> I've tried |xargs -J mv \[\] \[\].suffix and variations but that
> doesn't seem to work either. It seems to work fine with the -i
> command under GNU xargs, but not under Freebsd.
>
> An example would be
>
> $ touch one two three
> $ ls one two three | xargs -J [] mv [] [].suffix
>
> I should now have one.suffix two.suffix three.suffix. At least,
> that's what happens with GNU and the -i \{\}. (FreeBSD manpage says
> to use -J [] without escapes though.)
>
> Can anyone lend me a clue here please?
>
> TIA.
>
> --
> David S. Jackson dsj@dsj.net
Two things. First, from `man xargs`:
"Furthermore, only the first occurrence of the replstr will be
replaced." Second, maybe a different tool would be better. How
about:
$ for file in `ls one two three`; do move $file $file.suffix; done
Nathan
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?20021126035111.GB14336>
