3 ms·
Yeah plus seq can generate sequences with leading zeroes (something like seq -f %04.f 1 20). So instead of scripting, he could have generated a sorted list of
by mshook 8y ago
Yeah plus seq can generate sequences with leading zeroes (something like seq -f %04.f 1 20).
So instead of scripting, he could have generated a sorted list of numbers from the files he had. Created a file with the sequence of numbers for the range and diffed/commed the whole thing. Voilà...
- lelf 8y agoseq -f %04g 0 3 echo {0000..0003} # if bash
- v3gas 8y agoDid not know that. Thanks! That's much easier.
- pwg 8y agoThe seq provided in the GNU toolset has a -w flag to turn on "equal width" mode, so one can also get zero padded numbers out (from GNU seq) by turning on that mode and zero padding the input: $ seq -w 0001 0003 0001 0002 0003 $
- anc84 8y agoNice, this works automatically like this: $ seq -w 98 102 098 099 100 101 102