Jeff Blaine wrote:
> Bob Proulx wrote:
> > Why did that fail? ...
>
> [jblaine@new-host src]$ find /home/jblaine -mtime -1 -print | xargs
> /bin/basename
> /bin/basename: extra operand `/home/jblaine/.gconf/apps'
> Try `/bin/basename --help' for more information.
Ah... Yes, too many arguments. In that case ask xargs to not provide
that many.
Give this a try:
find . -type f -print0 | xargs -r0 -I{} basename {} .txt
And with dirname something like this:
find a -type f -print0 | xargs -r0 -L1 dirname
BTW... You shouldn't hard code paths such as /bin/basename. On some
systems basename is in /bin and and on some in /usr/bin. It is always
better to avoid hard coded paths, which create portability problems,
and instead locate programs from PATH.
Bob