Results for “working”
Small, practical examples. Search by task or narrow things down below.
Identify whether a name resolves to a builtin
Bash Scripts: type -t reports the command kind without printing a machine-specific path.
Bash Scripts✓ Tested
Ignore generated files
Exclude build output from untracked-file listings.
gitignore✓ Tested
Increase an integer variable
Bash Scripts: Increase an integer variable with a small standalone Bash program.
Bash Scripts✓ Tested
Increment a counter without an unexpected errexit
Bash Scripts: An assignment avoids the zero-result exit status of a standalone arithmetic post-increment.
Bash Scripts✓ Tested
Inspect every command status in a pipeline
Bash Scripts: Copy PIPESTATUS immediately before another command overwrites it.
Bash Scripts✓ Tested
Isolate variable changes in a subshell
Bash Scripts: Parentheses create a subshell whose variable assignments do not change the parent.
Bash Scripts✓ Tested
Join array items with a one-character separator
Bash Scripts: A local IFS controls the separator used by the quoted star expansion.
Bash Scripts✓ Tested
Keep a function variable local
Bash Scripts: Local prevents an ordinary function assignment from replacing a caller variable.
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
Limit a beginner function variable to local scope
Bash Scripts: Limit a beginner function variable to local scope with a small standalone Bash program.
Bash Scripts✓ Tested
List all files stored in a commit
Git: ls-tree inspects the committed tree without relying on working files.
Git✓ Tested
List changed files without the full diff
Inspect affected paths before staging.
diff✓ Tested