Results for “working”
Small, practical examples. Search by task or narrow things down below.
Read a file from a commit
Inspect committed content without changing your working copy.
show✓ Tested
Read a file without losing its last line
Handle spaces, backslashes, and a final line without a newline.
read lines✓ Tested
Read a line without losing backslashes
Bash Scripts: Read a line without losing backslashes with a small standalone Bash program.
Bash Scripts✓ Tested
Read a string’s character length
Bash Scripts: Bash parameter length counts characters under the current locale.
Bash Scripts✓ Tested
Read a variable whose name is stored in another variable
Bash Scripts: Indirect expansion performs one extra variable-name lookup.
Bash Scripts✓ Tested
Read an optional associative-array entry
Bash Scripts: Use a fallback expansion when a map key may not be present under nounset.
Bash Scripts✓ Tested
Read complete lines into an array
Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.
Bash Scripts✓ Tested
Read fields captured by a Bash regular expression
Bash Scripts: BASH_REMATCH contains the full match followed by capture groups after a successful regex test.
Bash Scripts✓ Tested
Read from a dedicated file descriptor
Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.
Bash Scripts✓ Tested
Read null-delimited filenames into an array
Bash Scripts: A null delimiter preserves spaces and embedded newlines in filenames.
Bash Scripts✓ Tested
Read part of a shell string
Bash Scripts: Read part of a shell string with a small standalone Bash program.
Bash Scripts✓ Tested
Read positional parameters in a function
Bash Scripts: Read positional parameters in a function with a small standalone Bash program.
Bash Scripts✓ Tested