Results for “Input streams & redirection”
Small, practical examples. Search by task or narrow things down below.
Compare two generated sorted streams
Bash Scripts: Process substitution lets a command consume another command’s output as a file-like input.
Bash Scripts✓ Tested
Pass a variable to standard input
Bash Scripts: A here-string supplies the expanded value followed by a newline.
Bash Scripts✓ Tested
Capture standard output and standard error separately
Bash Scripts: Use distinct redirections when diagnostic text should not be mixed with data.
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 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
Redirect an entire group of commands
Bash Scripts: Brace grouping runs in the current shell and shares a single output redirection.
Bash Scripts✓ Tested
Substitute values into a multiline template
Bash Scripts: An unquoted heredoc delimiter enables parameter expansion in the template.
Bash Scripts✓ Tested
Write a literal multiline block
Bash Scripts: Quoting the heredoc delimiter disables parameter and command expansion inside it.
Bash Scripts✓ Tested
Write several messages through one file descriptor
Bash Scripts: Open a destination once and close the descriptor after writing.
Bash Scripts✓ Tested
Accumulate pipeline input across begin process and end
PowerShell: Keep initialization and final output separate from per-item work.
PowerShell✓ Tested
Allow pointer input to pass through a decorative overlay
CSS: Pointer-events none excludes the overlay from ordinary pointer hit testing.
CSS✓ Tested