[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Splitting variable into two numbers
From: |
lisa-asket |
Subject: |
Splitting variable into two numbers |
Date: |
Tue, 20 Jul 2021 20:38:46 +0200 (CEST) |
I could get somewhere with the following
echo "{5,8}" | awk -F"[{}]" '{print $2}'
From: Greg Wooledge <greg@wooledge.org>
To: help-bash@gnu.org
Subject: Re: Splitting variable into two numbers
Date: 20/07/2021 20:26:32 Europe/Paris
On Tue, Jul 20, 2021 at 08:20:29PM +0200, lisa-asket@perso.be wrote:
> The multi-input is always enclosed within braces with no whitespaces.
> Thus "{5,8}", "{13,21}"
p=${input%,*} p=${p#\{}
q=${input#*,} q=${q%\}}
This still sounds like either an X-Y, or homework.
Am just searching through a list of files between lines p and q. Only did one
course
on data structures and hated it.
Re: Splitting variable into two numbers, Chris F.A. Johnson, 2021/07/20