On Fri, Jul 24, 2009 at 8:17 PM, Kamil Dudka<[email protected]> 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.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to