[ale] xargs w/ tr

Bob rstickel at bellsouth.net
Fri Jan 3 16:22:16 EST 2003


Apparently, the `echo ...` is evaluated before xargs does the %
substitution.  So the % gets translated to % (a no-op) and the mv call
becomes:

mv % %

--bs

On Fri, 2003-01-03 at 16:04, David S. Jackson wrote:
> On Fri, Jan 03, 2003 at 03:38:20PM -0500 Dow Hurst <dhurst at kennesaw.edu> wrote:
> > You could run xargs with the -p, or interactive option, to see what it 
> > has interpreted the command line to actually be.  Might help.
> > Dow
> 
> Yes, thanks.  Seems that the tr statement gets ignored altogether, but I
> still don't know why.  Here it is again...
> 
> locate *.{mp3,MP3} | xargs -p -I % mv % `echo %|tr A-Z a-z`
> 
> What gets delivered back is:
> 
> locate *.{mp3,MP3} | xargs -p -I % mv % `echo %|tr A-Z a-z`
> mv /home/dsj/Music/5th_Dimension--Wedding_Bell_Blues.mp3
> /home/dsj/Music/5th_Dimension--Wedding_Bell_Blues.mp3?...
> 
> So, as you can see, the target filename doesn't get lowercased.  (Yes, I
> see the problem with changing case in the pathname...)
> 
> Any ideas on why tr doesn't translate uppercase to lowercase here?
> 
> -- 
> David S. Jackson                        dsj at dsj.net
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> You can't have everything.  Where would you put it?
> 		-- Steven Wright
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale


_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list