Results for “environment”
Small, practical examples. Search by task or narrow things down below.
Export a value to child processes
Bash Scripts: Only exported shell variables are inherited through the environment.
Bash Scripts✓ Tested
Handle a nonzero background-job exit
Bash Scripts: Wait reports a child’s exit code; put it in a conditional when failure is expected.
Bash Scripts✓ Tested
Keep loop state by avoiding a pipeline subshell
Bash Scripts: Redirect input into a while loop so updates to a counter remain in the current shell.
Bash Scripts✓ Tested
Pass a named configuration value
Docker / Compose: Pass a named configuration value using a locally available Ubuntu image.
Docker / Compose✓ Tested
Preserve a failure status while an EXIT trap runs
Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.
Bash Scripts✓ Tested
Stop a child process created by the script
Bash Scripts: Send a signal only to the captured PID of the script’s own child and wait for it to exit.
Bash Scripts✓ Tested
Wait for a background job before reading its output
Bash Scripts: Save the job PID and wait explicitly before consuming files it produces.
Bash Scripts✓ Tested
Add a fixed hostname mapping
Docker / Compose: extra_hosts adds an entry to the container’s hosts file.
Docker / Compose✓ Tested
Assign a network-scoped alias
Docker / Compose: An alias gives an endpoint an additional name on that network.
Docker / Compose✓ Tested
Attach a descriptive label to a container
Docker / Compose: Attach a descriptive label to a container using a locally available Ubuntu image.
Docker / Compose✓ Tested
Attach an existing container to another network
Docker / Compose: network connect adds an attachment without recreating the container.
Docker / Compose✓ Tested
Attach containers to a user-defined network
Create a dedicated network for a small group of containers.
network✓ Tested