Todd Walton([EMAIL PROTECTED])@Mon, Jul 11, 2005 at 09:41:31PM -0700:
> On 7/11/05, Stewart Stremler <[EMAIL PROTECTED]> wrote:
> > 
> > In tcsh, you use stuff like :t and :r to to that. So something like:
> > 
> > foreach i ( /dir/full/of/files/* )
> >    wvText $i ${i:t:r}.text
> > end
> > 
> > ...does a fine job.
> 
> I'll try that.
> 
> > wvText $1 `basename $1 .doc`.text
> 
> No go.  When I create a shell script with this, and then run it on the
> files, it doesn't work.  Both:
> 
> $ myScript *
> $ ls |xargs myScript
> 
> convert only the first file, and not the rest.  This should work!

This happens because the script is only made to handle the first
argument. You need to incorporate a loop around the "core" command
that he showed you.

Take a look at John's post, too, if you haven't already.

The xargs command sends a bunch of args to the command at the same
time, it just breaks them down into smaller groups if you have a
very large number of them (500 if I remember Carl's lesson well
enough).  If you did something like:

$ echo * | xargs -n 1 myScript

That might work.  Not as nice as a for loop though.

Wade Curry
syntaxman


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to