Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes
Accepted

Why is sorted uniq -c command showing duplicates

uniq -c counts the lengths of sequences of consecutive lines that collate equally in the user's locale (for which strcoll(line1, line2) returns 0). If you get: 3 GitVersion.MsBuild 5.10.1 ...
Stéphane Chazelas's user avatar
2 votes
Accepted

Strip a line from a variable using awk or sed

var=$(grep -v '<title>' <<< $var) Would remove the lines that contain <title> from the contents of $var (beware it also removes trailing newline characters if any). Or you could ...
Stéphane Chazelas's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible