Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month, online, via Jitsi Meet.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Please help with a BASH puzzle



>
> .
>
> If you know what should be in the file then create a new file with the
> correct data


Or, itemize everything that could be in the file

and use diff to find the differnces.
>

If files are sorted, comm (1) is more efficient and has different output
options than diff (1).

If necessary, lc or uc the files.

The sort and comm must be wrto the same Locale Collation. LC_ALL=C for both
will assure that.

An awk, perl, or python generator command can be piped to one of the two
inputs of comm in modern bash via <() command syntax. I often put
canonicalizing commands in both.



Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org