Unable to set variable to command output
See original GitHub issueDescribe the bug
I would like to be able to create a notebook without revealing any API keys, so I wanted to set a shell variable to avoid command output with API keys being visible. Unfortunately it doesn’t appear to be possible to use $(command)
command substitution, or backticks. I even tried using read
Steps to reproduce the behavior
- Try to set a variable using one of the following…
export KEY=$(command)
or…
export KEY=`command`
or…
command | read KEY; export KEY
Expected behavior
I should be able to use the $KEY
environment variable in subsequent commands
Screenshots If applicable, add screenshots to help explain your problem.
System
- Kui version: recent (I couldn’t find the version in the UI anywhere, sorry)
- Operating system: OSX
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Unable to assign env variable using a command's output
I can set environment variables like this. ➤ foo=bar env | grep foo foo=bar. But, what if, I can only get foo=bar ...
Read more >Unable to assign output of command to a variable [duplicate]
But when I try to assign the output of the command to a variable then it gives error. as ./update.sh: line 12: platform:...
Read more >Environment variables to configure the AWS CLI
Environment variables provide another way to specify configuration options and credentials, and can be useful for scripting or temporarily setting a named ...
Read more >How to use variables in Azure CLI commands | Microsoft Learn
In this article. Prerequisites; Use shell variables; Set a subscription; Create default values; Use persistent values; Clean up resources ...
Read more >Set - Environment Variable - Windows CMD - SS64.com
Type SET with a variable name to display that variable. SET _department. The SET command invoked with a string (and no equal sign)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be doable. We’ll take a shot at it for the upcoming 10.4.0 release.
Please reopen this. It’s still an issue.
I am keen on using Kui with trainings that I do for SUSE/Rancher. It would make it easy for students to follow along and have the notebooks use variables that automatically customize themselves for each student’s environment:
Every time I try this, I run into this limitation around command substitution. It would be excellent if Kui supported it so that notebooks could be adaptable, allowing students to focus on learning instead of focusing on figuring out what IP was assigned to the ingress controller in their specific distribution of Kubernetes.