help-bash
[Top][All Lists]
Advanced

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

Re: #!shebang


From: Reuti
Subject: Re: #!shebang
Date: Wed, 20 Nov 2024 17:56:18 +0100

> Am 20.11.2024 um 17:49 schrieb Greg Wooledge <greg@wooledge.org>:
> 
>>> On Wed, Nov 20, 2024 at 16:33:46 +0100, #!microsuxx wrote:
>>>> declare -a "a=( $( <argsf ) )"
>>> 
>>> OK, that seems to work.  But it also doesn't seem to offer any
>>> advantages over the eval command.
> 
> On Wed, Nov 20, 2024 at 16:53:42 +0100, #!microsuxx wrote:
>> well ye functionally its same , just one lil less danger than eval
> 
> That's my point -- it's NOT less dangerous than eval.  It's exactly
> the same.
> 
> It's arguably worse, not in terms of how it behaves, but because of
> how it's perceived by the reader.  Look at your own statement here.
> You think it's "less danger[ous]" than eval.  Why?  Because you've been
> taught that eval is inherently dangerous?
> 
> eval is inherently dangerous; that much is true.  But your alternative
> behaves exactly the same way.  It's eval, spelled differently.  Yet
> you think it's safer.  That's a mental pitfall.

I got the idea to use `xargs` to split the arguments which include spaces to 
avoid `eval`:

./configuration.qemu | xargs qemu

-- Reuti

Attachment: signature.asc
Description: Message signed with OpenPGP


reply via email to

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