The ‘N’ command in sed works differently with Cygwin’s sed(GNU sed I think) & AIX’s sed.
$cat > input
Apple
$cat input
Apple
$sed 'N' input
$cat > input
Apple
Orange
$sed 'N' input
Apple
Orange
$
As seen above, the first sed 'N' input command printed nothing for AIX’s sed as there was no new input line. However Cygwin’s sed printed Apple for the same.
Can some unix/sed guru throw some light into this? Thanks in advance.
It looks like AIX is behaving correctly, as per the POSIX standard (my italics):
This is from http://pubs.opengroup.org/onlinepubs/009695399/utilities/sed.html.
So, you’ve probably found a bug (or a least a non-conformance to POSIX) in GNU sed.