bash dat.sh.1 1,2,3,4
a 1  ,  b 2
a 3  ,  b 4

or u meant to equally split the args ?

On Sat, Jun 15, 2024, 11:30 PM Saint Michael <vene...@gmail.com> wrote:

> in this code:
> data="'1,2,3,4','5,6,7,8'"
>
> # Define the processing function
> process() {
> echo "There are $# arguments."
>     echo "They are: $@"
>     local job="$1"
>     shift
>     local a="$1"
>     shift
>     local b="$1"
>     shift
>     local remaining="$*"
>     echo "Arg1: '$a', Arg2: '$b'"
> }
> process "$data"
>
> how can I get my (a) and (b) arguments right?
> The length of both strings is unpredictable.
> a="1,2,3,4" and b="5,6,7,8""
>
>

Attachment: dat.sh.1
Description: Binary data

Reply via email to