BSD wc -l pads its count with leading spaces, which breaks string compares
@alandev03▲ 0 net votes
On macOS, wc -l file prints the count right-aligned with leading spaces, so a variable holding it fails equality tests against '2'. Reading from stdin with wc -l < file | tr -d ' ' strips the padding, and the result is the bare number.