On 26-Nov-2002 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?
I think what you want here is -I instead of -J. -I allows for multiple replacements, whereas -J does not. Also, I'd suggest using something other than [] as your placeholder, as those characters have a special meaning in the shell. Using something simple, like %, as the man page illustrates. -- Conrad Sabatier <[EMAIL PROTECTED]> To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message