od --help says about these options: -S, --strings[=BYTES] output strings of at least BYTES graphic chars -w, --width[=BYTES] output BYTES bytes per output line man od says: -S, --strings[=BYTES] output strings of at least BYTES graphic chars -w, --width[=BYTES] output BYTES bytes per output line First, both are wrong about -S option parameter: it is not optional. That is, they should show --strings=BYTES, not --strings[=BYTES]. Second, what option -S actually does? I Its "description" is not clear at all, so I resorted to experimenting: I tried feeding it various files. On text files, it prints nothing - ??! On binary files (such as executables), it starts showing some strings >BYTES long, but it also skips a lot of other strings which are clearly longer than BYTES... In any case, description needs expanding. Third, please document what is the default value for -w WIDTH.
Regarding mysterious workings of od -S N: $ for i in 1 3 5 7 9 11 13; do { j=i; while test $((j--)) != 0; do echo -n $i; done; echo; } done 1 333 55555 7777777 999999999 1111111111111111111111 13131313131313131313131313 $ for i in 1 3 5 7 9 11 13; do { j=i; while test $((j--)) != 0; do echo -n $i; done; echo; } done | od -S9 Why od doesn't output, say, string 1111111111111111111111? it isn't longer than 9 chars??
First of all, Hi Denys, thanks for report. Second, --strings is supposed to have BYTES as optional(if optarg is NULL, default value 3 is used). Third, all default values are documented in od info documentation, which is the recommended source of information. For details about --strings option, please check "info coreutils 'od invocation'" which is recommended in manual page. If you already did so, feel free to come up with some suggestion, what should be improved/added to info documentation. I doubt man/help will get extended (other than default values, that probably makes sense). I'll check the rest on Monday... feel free to discuss that with me in the office ;).
(In reply to comment #2) > First of all, Hi Denys, thanks for report. > Second, --strings is supposed to have BYTES as optional(if optarg is NULL, > default value 3 is used). Yes. The problem is with short forms. -S WIDTH, WIDTH is not optional: $ od -S od: option requires an argument -- 'S' Try `od --help' for more information. whereas for -w it is optional: $ od -w <waits for input> ^C $ od -w 123 od: 123: No such file or directory The last command failed because for opts with optional args, "-wN" and "-w N" mean different things. In this particular case, "-w 123" means "option -w without parameter, followed by argument 123 (filename)". As it stands now, --help is not merely incomplete, it does not match reality: "All arguments to long options are mandatory for short options. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not true for -w -A, --address-radix=RADIX decide how file offsets are printed -j, --skip-bytes=BYTES skip BYTES input bytes first -N, --read-bytes=BYTES limit dump to BYTES input bytes -S, --strings[=BYTES] output strings of at least BYTES graphic chars -t, --format=TYPE select output format or formats -v, --output-duplicates do not use * to mark line suppression -w, --width[=BYTES] output BYTES bytes per output line "
Ok, for -w is --help not correct. It is probably worth of some wording correction. Even in short option format is the value optional. However - in info documentation are all these things sane.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle. Changing version to '23'. (As we did not run this process for some time, it could affect also pre-Fedora 23 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
Doing cleanup, this seems to be fixed by upstream commit http://git.savannah.gnu.org/cgit/coreutils.git/commit/src/od.c?id=850aa613e6b040784a9cc1c661bc59d91c315305. Closing CURRENTRELEASE.