[Top][All Lists]

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

Re: basename BSD compatibility and filter mode

From: Pádraig Brady
Subject: Re: basename BSD compatibility and filter mode
Date: Sat, 03 Mar 2012 16:04:27 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 03/03/2012 02:10 PM, Jérémy Compostella wrote:
> All,
> I'm interesting in implementing these features:
> 1. basename BSD options and behavior compatibility:
> Add the following options:
> -s, --suffix: specify the suffix
> -a, --multiple: every argument is treated as a string as if basename
> were invoked with just one argument.


> Moreover:
> - with more than two arguments basename acts as if -a was specified.

That would introduce an inconsistency if basename was run with 2 filenames.
So I think you must make -a explicit.

> - if -s is specified, act as if -a was specified too.


> Arguments for this feature is convenience and BSD compatibility. Let me
> know if this is sufficient to provide it in GNU/coreutils.
> 2. basesame acts as a filter:
> The
> post convince me that maybe this feature is not relevant because there
> are actually other very simple ways to achieve this.
> What do you think?

Right. If basename is not taking from stding then
it doesn't need the -z option to split on \0 I think,
since xargs will do that for us:

find | xargs -r0 basename -a


reply via email to

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