Program / Pass File Contents To Another Program Via Stdin
Pass File Contents To Another Program Via Stdin
Program command syntax to pass file contents to another program via stdin. Copyable examples, output expectations, and common mistakes.
$
Terminal cat path/to/file | program cat path/to/file | program #!/bin/bash
# Pass File Contents To Another Program Via Stdin
cat path/to/file | program Command Breakdown
What each part is doing
-
cat - Base Command
- The executable that performs this operation. Here it runs Program before the shell applies any redirect operators.
Alternative Approaches
Comparable commands in other tools
Alternative filesystem tools for the same job.
Ispell / Check Typos In File
ispell <path/to/file> Cat / Write Stdin To File cat - > <path/to/file> Sfdisk / Restore Partition Layout From File sudo sfdisk < <path/to/file.dump> </dev/sdX> Dirname / Calculate Parent Directory Single Path dirname <path/to/file_or_directory> Command / Process File Redirect To Another <command> < <path/to/file.txt> > <path/to/file2.txt>