Re: Portability of $(expr) vs `expr` in bash



Hello Leonard,


On Thu, 28 Jul 2005 23:26:18 +0200 Leonard den Ottolander
<leonard den ottolander nl> wrote:

> Hi,
> 
> I'm wondering if the usage of $(expr) vs `expr` in bash scripts is
> portable, ie if we could get rid of all the unnecessary spawning of
> shells for such expressions by replacing the latter with the former.

Some questions come to my mind:

$(expr) is not supported by some shells (it's more a question of shell family
than shell fresh-ness, excepted for bash itself), do you really mean "bash" in
your post, or "shell"?

If your concern is "bash" only:

How old are the bash versions that don't support $(expr)?

Are there really still some systems running such old and poor-featured bash
versions?

Do you still want to support such bash versions, aren't there other points
that make support for these bash versions impossible?

Would there be other interests in using `expr` anyway (excepted that `expr`
works for non-bash shells)?

My 2 cts.


Regards,

-- 
wwp



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