help-bash
[Top][All Lists]
Advanced

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

Re: #!shebang


From: #!microsuxx
Subject: Re: #!shebang
Date: Wed, 20 Nov 2024 16:33:46 +0100

try with -a ..

declare -a "a=( $( <argsf ) )"
~ $ declare -p a
declare -a a=([0]="-one" [1]="--two" [2]=" three four " [3]="--five"
[4]="bar")
~ $ cat argsf
-one
--two " three four " # com1
--five #com
bar~ $

On Wed, Nov 20, 2024, 3:00 PM Greg Wooledge <greg@wooledge.org> wrote:

> On Wed, Nov 20, 2024 at 14:49:09 +0100, #!microsuxx wrote:
> > u can replace eval with declare , or any other builtin i think ..
>
> No, that is not equivalent.  With the quotes:
>
> hobbit:~$ declare "a=( $(<z) )"; args "${a[@]}"
> 1 args: <( -foo
> # a whole line comment
> -file="a file with spaces"
> -bar # an inline comment
> -q )>
>
> Or without the quotes:
>
> hobbit:~$ declare a=( $(<z) ); args "${a[@]}"
> 16 args: <-foo> <#> <a> <whole> <line> <comment> <-file="a> <file> <with>
> <spaces"> <-bar> <#> <an> <inline> <comment> <-q>
>
> Neither one does what I want.  What is your *actual* proposal?
>
>


reply via email to

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