bug-coreutils
[Top][All Lists]
Advanced

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

Re: A request for addition of a command


From: James Youngman
Subject: Re: A request for addition of a command
Date: Mon, 27 Jul 2009 00:54:04 +0100

On Fri, Jul 24, 2009 at 8:17 PM, Kamil Dudka<address@hidden> wrote:

>> 2. Negative path to eliminate the part of the path.
>>
>>    <path0> - <path1>
>>
>> This removes the <path1> from the end of <path0>.
>>
>>    - <path0> + <path1>
>>
>> This removes the <path0> from the beginning of <path1>
>
> The algebra seems really strange to me. Has the '-' operator usual semantic
> of unary '-' (meaning inverse element with regards to binary operation '+')?
> Then should the following be always true:
>    1. -(-a) == a
>    2. a - b == a + (-b)
>
> Do we have any real life use-case for the operator '-'? I think concatenation
> with "/.." and/or sed invocation are mostly sufficient.

Or the word transformation operators /, %% and ## built into the shell.

$ x=foobar; echo ${x%%bar} ; echo ${x##foo}; echo ${x/oob/_}
foo
bar
f_ar

James.




reply via email to

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