[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: minor documentation suggestion for FS values and "whitespace" in gen
From: |
Eli Zaretskii |
Subject: |
Re: minor documentation suggestion for FS values and "whitespace" in general |
Date: |
Tue, 24 Mar 2020 16:12:41 +0200 |
> From: Ed Morton <address@hidden>
> Date: Tue, 24 Mar 2020 08:46:05 -0400
>
> Thanks Arnold. I assume you meant to say whitespace is ' ' and '\t' and
> '\n' on UNIX at least given:
>
> $ printf 'a b\nc\n' | awk -v RS='#' '{print NR, NF; for (i=1; i<=NF;
> i++) print i, "<" $i ">"}'
> 1 3
> 1 <a>
> 2 <b>
> 3 <c>
>
> but is that still true on Windows or is it ' ' and '\t' and '\r\n' there
> or something else? I don't have a Windows environment to test it in.
If you are thinking the NL vs CRLF issue, then it won't be a problem
on Windows, as NL will be silently converted to CRLF. A more serious
problem is that \n will not produce a newline on Windows and \t won't
produce a TAB, since the shell there doesn't do such conversions.