[TUHS] sh: cmd | >file

Dave Horsfall dave at horsfall.org
Tue Jan 7 08:22:24 AEST 2020


On Mon, 6 Jan 2020, Chet Ramey wrote:

>> I have never used all the fancy stuff in BASH such as the arithmetic 
>> functions; I still use "expr" etc for portability.
>
> Portability to what? The POSIX $((...)) arithmetic expansion is widely 
> implemented and near-universally available.

As I said, I never bothered to learn "$((...))" because "expr" works just 
fine.  And I might come across an old machine at some time; I come from 
the school of "Make it work before making it pretty" and I extend that to 
backwards compatibility.

And "expr" is burned into my brain :-)

> Some of the other things are more esoteric, but you should be able to 
> increase your expectation to POSIX features and still be sufficiently 
> portable.

I might get around to it, but at 67 I may not have much time (or 
incentive)...  Besides, programming is only a hobby for me, as I'm long 
retired.

-- Dave


More information about the TUHS mailing list