[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: why fail , [[ $sep$*$sep == $sep--$sep ]]
From: |
alex xmb sw ratchev |
Subject: |
Re: why fail , [[ $sep$*$sep == $sep--$sep ]] |
Date: |
Sun, 18 Feb 2024 14:34:43 +0100 |
On Sun, Feb 18, 2024, 14:18 Kerin Millar <kfm@plushkava.net> wrote:
> On Sat, 17 Feb 2024 17:01:13 +0100
> alex xmb sw ratchev <fxmbsw7@gmail.com> wrote:
>
> > oh i know why it failed
> > set interprets the first -- away
>
> That is not why it is failing to behave as you expect. Rather, the issue
> is that your conditional expression is incorrect. It should be [[ "$f$*$f"
> == *"$f--$f"* ]]. Note that you have chosen to change the value of IFS. It
> is important that you do not omit the quotes - not even for the left hand
> side of the expression!
>
i thought there is a ' flat left side of == '
Not only will you need to know whether -- is present, but you will also
> need to know its position. As such, you will need to implement a proper
> argument parser anyway. At that point, such a test becomes nothing more
> than a needless expenditure of resources. Besides, it will not handle
> arguments containing $'\1' correctly.
>
i agree , its a cheap thing
yes i parse args and assert then accordingly .. is the
--
> Kerin Millar
>
- why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Greg Wooledge, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/17
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Kerin Millar, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]],
alex xmb sw ratchev <=
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Kerin Millar, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Kerin Millar, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Chet Ramey, 2024/02/20
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Lawrence Velázquez, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Kerin Millar, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Greg Wooledge, 2024/02/18
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], Chet Ramey, 2024/02/20
- Re: why fail , [[ $sep$*$sep == $sep--$sep ]], alex xmb sw ratchev, 2024/02/20