Results for “Inspecting the working tree”
Small, practical examples. Search by task or narrow things down below.
Convert a variable to uppercase
Bash Scripts: Double caret transforms matching lowercase characters in Bash 4 or later.
Bash Scripts✓ Tested
Copy an array independently
Bash Scripts: A new array assignment copies element values rather than creating a shared reference.
Bash Scripts✓ Tested
Correct the latest unpublished commit message
Git: Amend replaces the current commit while preserving its tree when no new changes are staged.
Git✓ Tested
Count array elements
Bash Scripts: Count array elements with a small standalone Bash program.
Bash Scripts✓ Tested
Count down with a while loop
Bash Scripts: Count down with a while loop with a small standalone Bash program.
Bash Scripts✓ Tested
Count the elements in an array
Bash Scripts: The array length form counts assigned elements, not characters in the first value.
Bash Scripts✓ Tested
Create nested directories
Create a directory tree using the .NET Directory API.
C#✓ Tested
Create nested directories
Use C++17 filesystem to create a directory tree.
C++✓ Tested
Declare a fixed configuration value
Bash Scripts: Declare a fixed configuration value with a small standalone Bash program.
Bash Scripts✓ Tested
Define and call a shell function
Bash Scripts: Define and call a shell function with a small standalone Bash program.
Bash Scripts✓ Tested
Detect an error inside a pipeline
Use pipefail to observe failure before the last pipeline command.
pipefail✓ Tested
Discard an unstaged edit to one tracked file
Git: Restore copies the index version back into the selected working file.
Git✓ Tested