Re: Why regex doesn't work in while loop's condition?

2019-09-08 Thread gwes
On 9/6/19 5:27 PM, Theo de Raadt wrote: Andreas Kusalananda Kähäri wrote: On Fri, Sep 06, 2019 at 02:38:18PM -0600, Theo de Raadt wrote: Christian Weisgerber wrote: On 2019-09-06, Andreas Kusalananda Kähäri wrote: read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done

Re: Why regex doesn't work in while loop's condition?

2019-09-06 Thread Theo de Raadt
Andreas Kusalananda Kähäri wrote: > On Fri, Sep 06, 2019 at 02:38:18PM -0600, Theo de Raadt wrote: > > Christian Weisgerber wrote: > > > > > On 2019-09-06, Andreas Kusalananda Kähäri wrote: > > > > > > >> read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done > > > > > > > >

Re: Why regex doesn't work in while loop's condition?

2019-09-06 Thread Andreas Kusalananda Kähäri
On Fri, Sep 06, 2019 at 02:38:18PM -0600, Theo de Raadt wrote: > Christian Weisgerber wrote: > > > On 2019-09-06, Andreas Kusalananda Kähäri wrote: > > > > >> read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done > > > > > > The shells in the OpenBSD base system do not support

Re: Why regex doesn't work in while loop's condition?

2019-09-06 Thread Raul Miller
On Fri, Sep 6, 2019 at 2:40 PM JohnS wrote: > Why next construction doesn't work? > > read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done People have been focusing on the syntax of arguments for test (the left bracket operation), but there's no 'next' here. You are reading x

Re: Why regex doesn't work in while loop's condition?

2019-09-06 Thread Theo de Raadt
Christian Weisgerber wrote: > On 2019-09-06, Andreas Kusalananda Kähäri wrote: > > >> read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done > > > > The shells in the OpenBSD base system do not support matching regular > > expressions with that syntax. You may have been

Re: Why regex doesn't work in while loop's condition?

2019-09-06 Thread Christian Weisgerber
On 2019-09-06, Andreas Kusalananda Kähäri wrote: >> read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done > > The shells in the OpenBSD base system do not support matching regular > expressions with that syntax. You may have been thinking of bash, Just to head off crazy rumors:

Re: Why regex doesn't work in while loop's condition?

2019-09-06 Thread Andreas Kusalananda Kähäri
On Fri, Sep 06, 2019 at 08:55:10PM +0200, Andreas Kusalananda Kähäri wrote: > On Fri, Sep 06, 2019 at 11:39:06PM +0500, JohnS wrote: > > Hi, all! > > > > Why next construction doesn't work? > > > > read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done > > > > I tried many

Re: Why regex doesn't work in while loop's condition?

2019-09-06 Thread Andreas Kusalananda Kähäri
On Fri, Sep 06, 2019 at 11:39:06PM +0500, JohnS wrote: > Hi, all! > > Why next construction doesn't work? > > read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done > > I tried many variants but can't make it work. Moreover I don't understand WHY > it > doesn't work?! > >

Why regex doesn't work in while loop's condition?

2019-09-06 Thread JohnS
Hi, all! Why next construction doesn't work? read x; while [ "$x" != [abc] ]; do echo "Not a, b or c"; break; done I tried many variants but can't make it work. Moreover I don't understand WHY it doesn't work?! Thanks!