-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eval evil? #59
Comments
Unfortunately we can't do Since we have |
i see.
or ideally:
I'm hoping that we've just discovered a lowhanging fruit here :) |
Your version would print "true" in the below code: unset s
if set? s
echo "true" We should probably add tests to the std lib soon, so we can experiment better :P The reason we need an equivalent to |
Afaik in shellscript reference-notation (without $) is only used in (undoing) declarations & assignments, not in if-statements etc.
Let me know what u think. |
But that will print false below. s=""
if set? $s
echo true
else
echo false There is no meaning in |
Actually, that will print true, I forgot about auto quoting. However, that means that unset s
if set? $s
echo "true" Will print true with your version. |
hm, im on the bus right now, so i'll have to digest these truths about
shellscript :)
On Sep 4, 2018 5:30 PM, "fcard" <notifications@github.com> wrote:
But that will print false below.
s=""
if set? $s
echo true
else
echo false
There is no meaning in set? without references.
There are many uses in references, they are normally just too annoying in
shell script to use :P
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAK_ZLzl3ESjgafrCvoF0EbdE7q6MYkTks5uXpysgaJpZM4WXDHU>
.
|
So from what i've understood is that the compiler is using eval, to stay flexible concerning bash vs sh output.
So powscript generally produces this type of output:
@fcard: Might there be a way to get rid of the eval you think?
Could we get away with this kind of output in most cases? :
That way powscript can also be attractive to people who dismiss the usage of eval (because of security reasons).
Looking at all my powscript-output, I haven't really seen a case where wrapping shellscript in an eval-call was necessary.
WDYT?
The text was updated successfully, but these errors were encountered: