help-bash
[Top][All Lists]
Advanced

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

Re: Option immediately followed by a number


From: alex xmb ratchev
Subject: Re: Option immediately followed by a number
Date: Sun, 19 Mar 2023 20:42:01 +0100

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}

>


reply via email to

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