You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before we added string interpolation we could do things like this:
alias create my-alias "echo foobar | echo $body[0]"
The variable would then be substituted as normal when the alias was executed.
> my-alias
> foobar
Now when we try to do something like the above the parser returns an error: Note: error responses are returned as standard command errors. I've just removed everything except the actual error message for brevity.
Using the string interpolation syntax doesn't work because the variables are replaced when trying to create the alias, resulting in a "can't find the variable" error.
> alias create my-alias "echo foobar | echo ${body[0]}"
> I can't find the variable '$body'.
Using a slash before the variable allows for successful creation of the alias, but the slash is then displayed in the output when the alias is executed:
> alias create my-alias "echo foobar | echo \$body[0]"
> Alias 'user:my-alias' has been created
> my-alias
> \ foobar
The text was updated successfully, but these errors were encountered:
Before we added string interpolation we could do things like this:
alias create my-alias "echo foobar | echo $body[0]"
The variable would then be substituted as normal when the alias was executed.
Now when we try to do something like the above the parser returns an error:
Note: error responses are returned as standard command errors. I've just removed everything except the actual error message for brevity.
Using the string interpolation syntax doesn't work because the variables are replaced when trying to create the alias, resulting in a "can't find the variable" error.
Using a slash before the variable allows for successful creation of the alias, but the slash is then displayed in the output when the alias is executed:
The text was updated successfully, but these errors were encountered: