coreutils
[Top][All Lists]
Advanced

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

How to count the last line when it does not end with a newline character


From: Peng Yu
Subject: How to count the last line when it does not end with a newline character?
Date: Sun, 5 Sep 2021 00:37:50 -0500

I got 1 instead of 2 in the following example. How to count the last
even when it does not end with a newline character? Thanks.

$ printf 'a\nb'|wc -l
1

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]