invocation-option

Bash -s [--] [argument ...]

Reads shell source from standard input rather than treating the first remaining operand as a script filename. Remaining operands populate positional parameters. Input is executable source, so only pipe trusted script text; use a script with separate data input for untrusted records. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): count=1 value=[daily report].

Formal Syntax & Structure

bash syntaxbash
bash -s [--] [argument ...]

Parameters & Attributes

NameTypeDescription
argumentstringPositional argument passed to the input script.

Return Value

exit status

See the example and command status; failures are nonzero.

Working Example

Example Snippetbash
printf '%s\n' 'printf "count=%s value=[%s]\n" "$#" "$1"' |    bash --noprofile --norc -s -- 'daily report'
Bash Reference