Results for “require”
Small, practical examples. Search by task or narrow things down below.
Stash only the staged changes
Git: The staged option saves index changes while keeping unrelated unstaged edits.
Git✓ Tested
Stash unstaged work while leaving staged edits available
Git: Keep-index preserves the staged state for testing or committing while stashing the rest.
Git✓ 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
Stop a running container gracefully
Docker / Compose: stop sends the configured stop signal and waits before forcing termination.
Docker / Compose✓ Tested
Stop a search loop at the first match
Bash Scripts: Break exits the current loop as soon as the desired item is found.
Bash Scripts✓ Tested
Stop tracking a generated file while keeping it locally
Git: Removing a path from the index leaves its working copy intact when cached is specified.
Git✓ Tested
Store a value in a named variable
TypeScript: Give a value a descriptive name and print it.
TypeScript✓ Tested
Store and iterate over an array
Bash Scripts: Store and iterate over an array with a small standalone Bash program.
Bash Scripts✓ Tested
Store text in a variable
Bash Scripts: Store text in a variable with a small standalone Bash program.
Bash Scripts✓ Tested
Substitute a value for NULL
Use SQL Server’s ISNULL expression.
ISNULL✓ Tested
Substitute values into a multiline template
Bash Scripts: An unquoted heredoc delimiter enables parameter expansion in the template.
Bash Scripts✓ Tested
Sum a collection
Calculate a total with Measure-Object.
Measure-Object✓ Tested