coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coreutils] basename/dirname can't handle stdin?


From: Jeff Blaine
Subject: Re: [coreutils] basename/dirname can't handle stdin?
Date: Thu, 13 Jan 2011 20:07:00 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

On 1/13/2011 7:55 PM, Bob Proulx wrote:
Jeff Blaine wrote:
Bob Proulx wrote:
Why did that fail? ...

[jblaine@new-host src]$ find /home/jblaine -mtime -1 -print | xargs 
/bin/basename

Yes, I've found there are a few ways around the lack of
"filter mode" in GNU basename.  That there are other
solutions doesn't negate the idea that it can/should be
able to work in "filter mode" like so many other chainable
applications, right?

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.

I didn't hardcode anything :)  I specified the basename
binary I wanted to use here because there is another one in
my PATH before /bin (the basename code I am working on!  And
I want it there at the front)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]