Juliano F. Ravasi wrote:

    I got bitten by two unexpected (and undocumented) behaviors of
    the 'read' builtin.

    The first one is that it doesn't seem to handle word separators
    equally, making distinction when spaces and non-space
    separators are used to separate words.

Posix makes the distinction explicit.  Read the `Field Splitting'
section (2.6.5) in
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_05


    The second one is that it chops leading and trailing whitespace
    when you provide one variable for assignment, and not when you
    use the default $REPLY.

This is the behavior to which the language in the man page that talks
about `the line read' being assigned to REPLY refers.  Bash behaves as
it does when using REPLY to make it easy to read an entire line verbatim
without having to temporarily alter $IFS.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


Reply via email to