bug-bash
[Top][All Lists]
Advanced

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

Re: "printf %d ''" should diagnose the empty string


From: Martin D Kealey
Subject: Re: "printf %d ''" should diagnose the empty string
Date: Tue, 26 Nov 2024 11:31:05 +1000

How about a counter-proposal: when not in POSIX mode, arguments that
correspond to numeric conversions in printf could be subject to normal
arithmetic evaluation, so that « printf %d '6*7' » will output “42”.

(Yes of course they should be subject to the single evaluation limit,
regardless of any shopt to the contrary.)

That would include evaluating an empty *expression* as zero.

-Martin


reply via email to

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