[ale] xargs

David S. Jackson deepbsd at earthlink.net
Mon Nov 25 21:13:29 EST 2002


On Mon, Nov 25, 2002 at 05:42:30PM -0500 Dow Hurst <dhurst at kennesaw.edu> wrote:
> You'd need to be in the same directory where you were running the 
> command since you've given ls the....
> 
> Wait a minute.  Is that a number one or the letter L? :-)
> Dow

Okay, here's the scoop, I think.

First, I'm using FreeBSD, and its xargs is significantly
different from GNU's, so that was a good part of the problem.  

Second, the command, which works fine in Linux, is

$  touch one two three
$  ls one two three | xargs -i mv \{\} \{\}.suffix

Now you have one.suffix two.suffix three.suffix.

To move them back, you could go

$  ls {one,two,three}* | xargs -i basename \{\} .suffix \
 | xargs -i mv \{\}.suffix \{\}

So, I'm banging my head on the manpage for xargs in freebsd,
where -J is supposed to be equivalent to -i, but it doesn't seem
to work out that way...  :-)

Oh, -1 was a number one.  That argument to ls forces the output
to be in a single column.  I guess is isn't necessary here, but I
can't help myself...

-- 
David S. Jackson                        dsj at dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
There comes a time in the affairs of a man when he has
to take the bull by the tail and face the situation.
		-- W.C. Fields
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list