- But I would probably miss something.
- Another way I could do this is with the *nix program diff
- diff compares two text files and
- Indicates where the lines are different.
- It event attempts to sync up with missing lines.
- It is really useful
-
% numberWord > outfile
% diff Standard outfile
1,10c1,12
< 0 is Zero.
< 1 is One.
< 2 is Two.
< 3 is Three.
< 4 is Four.
< 5 is Five.
< 6 is Six.
< 7 is Seven.
< 8 is Eight.
< 9 is Nine.
---
>
> 0 isZero.
> 1 isOne .
> 2 istoo.
> 3 isThree.
> 4 isFore.
> 5 isFive.
> 6 isSeven.
> 7 isSeven.
> 8 isEight.
> 9 isNine.
> 10 isUnknown.
\ No newline at end of file
%
- Notice the lines with differences are printed.
- Then a < indicates the line in the first file
- And a > indicates a line in the second file
-
< 0 is Zero.
...
> 0 isZero.
- These lines differ in spacing at least
-
< 4 is Four.
...
> 4 isFore.
There is also a difference in spelling.
- This is nice, but pipes provide a short cut
-
numberWord | diff - Standard
- Or even
-
numberWord | diff - Standard | more