-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
websites/nicoretti.github.io/docs/blog/posts/ddoc/oneshot-env-vars.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
date: 2024-04-25 | ||
categories: | ||
- DDOC | ||
- CLI | ||
- ENV | ||
- TERMINAl | ||
- SHELL | ||
--- | ||
|
||
# Daily Dose Of CLI \#2 | ||
|
||
## Temporary ENVIRONMENT Variable(s) | ||
|
||
In various shells, it is possible to create a temporary environment variable for a specific process and its children by defining them immediately before the shell command that spawns the process. | ||
|
||
Command: | ||
```shell | ||
TMP1="Hello," TMP2="World" bash -c 'echo $TMP1 $TMP2!' | ||
``` | ||
Output: | ||
``` | ||
Hello, World! | ||
``` | ||
|
||
Command: | ||
```shell | ||
TMP="Temp ENV VAR" env | ||
``` | ||
Output: | ||
``` | ||
... | ||
TMP=Temp ENV VAR | ||
``` | ||
|
||
### References | ||
* [`man 8 ip`](https://linux.die.net/man/8/ip) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters