Re: [PATCH v2] mergetool: use more conservative temporary filenames

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

 



Jakub Narębski <jnareb@xxxxxxxxx> writes:

> Why use expr and not POSIX shell parameter substitution?
>
> BASE=${MERGED%.*}
> ext=.${MERGED##*.}
>
> Or something like that...

Because they are insufficient.  See David's illustrations for how.

Parameter expansion (e.g. ${parameter%word}) is fine for the
simplest cases (e.g. you know there is .c suffix to the $string and
want to strip it out) but not sufficient for other cases (e.g. you
may not even know if there is any suffix).  You can deconstruct your
regexps manually and use conditional if/else/fi if you are unable to
use expr, but I do not see how it buys us anything.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]