On Tue, Jul 20, 2021 at 06:15:32PM +0200, lisa-asket@perso.be wrote:
> I would like to split a variable containing two numbers delimited by a comma
>
> and transfer the two numbers into two variables p and q.
p=${input%,*} q=${input#*,}
> Input:
>
> var="{5,8}"
STOP!
All of a sudden, this is an X-Y problem. You don't have "two numbers
delimited by a comma". You have something else entirely. There are
curly braces now. I wonder what else is in there.
Is it really JSON?
What's the *actual* goal here? Where does this input come from, what
does it *really* look like (before any mangling you've already done
on the X-Y path), and what are you trying to do with it?