[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Option immediately followed by a number
From: |
uzibalqa |
Subject: |
Re: Option immediately followed by a number |
Date: |
Sun, 19 Mar 2023 20:02:07 +0000 |
------- Original Message -------
On Monday, March 20th, 2023 at 7:42 AM, alex xmb ratchev <fxmbsw7@gmail.com>
wrote:
>
>
> On Sun, Mar 19, 2023, 8:08 PM uzibalqa <uzibalqa@proton.me> wrote:
>
> >
> > I want to match a string composed of "-n" immediately followed by a number.
> > Meaning at least one number after "-n".
> >
> > For instance "-n8", "-n21", "-n34"
> >
> > How can I make a glob pattern that matches the above description that I can
> > use with the case statement?
> >
> > case $opt in
> > ("-n") do-this ;;
> > esac
>
>
> n=${opt#-n}
I am focused about what to use instead of ("-n") within the case statement.
Have done
("-n"+[[:digit:]])
But there is something wrong with it.