Unquoted report final.md splits into two arguments; quoted expansion preserves one.

Shell word splitting turns unquoted variables into several arguments

A shell variable holds a string, but an unquoted expansion can turn that string into several command arguments. In Bash, word splitting examines expansion results using IFS as the delimiter set. This is why a pathname that works when typed with quotes can fail after being stored in a variable. Debug the arguments the receiving command actually gets, including empty ones, before blaming the filesystem. ...

December 31, 2027 · 4 min · XB Field Notes
A separate $0 identity stays fixed while shift removes the empty first positional argument and moves two words from $2 to $1.

Shell positional arguments are a numbered list

A shell script receives an ordered argument list, not a single command-line string that it must split again. Positional parameters expose that list as $1, $2, and subsequent entries; $# reports its size. A small fixed interface can use these positions directly. Optional settings and flags benefit from explicit parsing, but either design still needs to define the permitted count, empty values, and failure behavior. ...

November 29, 2027 · 5 min · XB Field Notes
Unset and empty states both flow to a colon default; omitting the colon preserves an empty value.

Shell parameter expansion rewrites values

Parameter expansion derives a value from a shell parameter before a command receives its arguments. It can provide a default, reject missing configuration, or remove part of a string without launching another process. This is expansion during execution, not an instruction to evaluate every variable when the script is first parsed: a function reads the current value when it runs. ...

November 16, 2027 · 4 min · XB Field Notes
One ./*.txt pattern becomes three separate Bash arguments, including ./two words.txt intact.

Bash globbing expands before the command runs

A wildcard in a Bash command usually becomes a list of pathnames before the target program starts. That makes *.txt convenient, but it also makes the command depend on the current directory and shell options. The program receives arguments, without information saying which ones came from a wildcard. Decide whether you intend to pass matching files or a pattern for the program to interpret. ...

September 8, 2027 · 4 min · XB Field Notes
Four exact values retain four boundaries when forwarded with quoted dollar-at.

$@ and friends give a function its whole argument list

A wrapper should pass the arguments it received without changing their boundaries. In Bash, "$@" does that when used as command arguments: each positional parameter becomes a separate quoted word. This matters for empty values, spaces, newlines, and literal wildcard characters. A command that happens to work with two simple filenames can still be broken if its wrapper reconstructs the list as a single string. ...

April 16, 2027 · 4 min · XB Field Notes
The current-status lane starts with failed work returning 7 and later successful logging returning 0. An immediate capture branches down to a saved=7 lane that persists independently until explicit return or exit.

Exit status is a compact report of what went wrong

An exit status is a small value that a shell uses to decide what runs next. Zero means success for shell control flow; a nonzero status takes the failure branch. That does not give every number a universal application meaning. A search with no matches, invalid input, and an unavailable server may deserve different handling even though all can produce nonzero results. Read the command’s contract before deciding what to retry or ignore. ...

March 27, 2027 · 4 min · XB Field Notes
Inside one shared shell, a function gets its own positional list, shifts it, then returns to the unchanged caller list. Shared variables sit alongside those temporary argument frames.

A shell function reads its arguments like a script

A shell function groups commands under a name and receives its own positional arguments. In an ordinary call, its body runs in the current shell rather than automatically starting a separate process. That makes functions useful for reusable operations, but it also means assignments, directory changes, and other shell state can affect the caller. A function needs an explicit contract for inputs, output, status, and any intentional side effects. ...

March 16, 2027 · 5 min · XB Field Notes
A stdout tape containing first, an internal newline, second and two trailing newlines becomes captured text first newline second; the internal newline stays and both trailing newlines are removed.

Command substitution puts one command's output into another line

Command substitution captures a command’s standard output and inserts the resulting text into a surrounding expression. The familiar $(command) form is useful for a timestamp, a computed label, or another small textual value. It is not a transparent channel for arbitrary bytes or a reliable way to transport a list of filenames. Its newline handling, execution environment, and exit status are part of the interface you need to understand. ...

March 3, 2027 · 5 min · XB Field Notes