Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
od: support multiple input files (#463)
* od: support multiple input files * Standards document specifies multiple input files should be processed [1] * Follow BSD od and don't treat '-' argument specially; read stdin only if no arguments are given * Update usage string * Options -N and -j affect the input stream overall, not just the 1st file processed * Uneven input data left over at EOF is combined with input from the next file * Uneven input data at end of the last file gets its own dump_line() call * Formatting routines are now written without the need for global $pffmt * test1: "echo hello | perl od -c -N 2" --> format 1st two bytes from stdin as characters * test2: "od -j 1 -x awk ar" --> dump awk and ar files as hex, skipping 1st byte of input 1. https://pubs.opengroup.org/onlinepubs/009696899/utilities/od.html * kill extra return statement * emit_offset() conditionally prints newline or space
- Loading branch information
Showing
1 changed file
with
99 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters