help-bash
[Top][All Lists]
Advanced

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

Checking numeric arguments


From: irenezerafa
Subject: Checking numeric arguments
Date: Wed, 17 Nov 2021 15:24:43 +0000

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, November 17th, 2021 at 8:46 AM, Alex fxmbsw7 Ratchev 
<fxmbsw7@gmail.com> wrote:

> and no need to quote that left side inside [[

Is that because there will never be any splitting for numeric values?

> On Wed, Nov 17, 2021, 09:46 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> wrote:
>
>> you can combine && etc inside [[ too
>>
>> On Wed, Nov 17, 2021, 09:45 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> wrote:
>>
>>> it.. would work, imho
>>>
>>> On Wed, Nov 17, 2021, 04:04 irenezerafa via <help-bash@gnu.org> wrote:
>>>
>>>> I want to check if arguments are numeric. Is the following a good way, 
>>>> using case-like patterns
>>>> and using = inside double bracketing [[ ]].
>>>>
>>>> if [[ "$2" = +([[:digit:]]) ]] && [[ "$3" = +([[:digit:]]) ]]; then

reply via email to

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