sed 4.2.2 does not operate on streams when --follow-symlinks is passed

Luke T. Shumaker <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <87d2xeewgn.wl%[email protected]>
sed 4.2.2 introduced the change from 4.2.1 that the
`--follow-symlinks` option breaks sed's ability to operate on
streams.

This option is clearly non-applicable in the situation of editing a
stream, but should not break in that situation.

This new behavior is an inconvenience to users who may have created
an alias for sed, as I have:
    alias sed='sed --follow-symlinks'

Version information:
    $ sed --version
    sed (GNU sed) 4.2.2
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    Written by Jay Fenlason, Tom Lord, Ken Pizzini,
    and Paolo Bonzini.
    GNU sed home page: <http://www.gnu.org/software/sed/>.
    General help using GNU software: <http://www.gnu.org/gethelp/>.
    E-mail bug reports to: <[email protected]>.
    Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.
    
Problem testcase:
    $ type sed
    sed is aliased to `sed --follow-symlinks'
    $ sed s/foo/bar/ <<<foo
    /bin/sed: cannot stat -: No such file or directory

    $ /bin/sed --follow-symlinks s/foo/bar/ <<<foo
    /bin/sed: cannot stat -: No such file or directory

Work-around 0:
    $ /bin/sed s/foo/bar/ <<<foo
    bar

Work-around 1:
    $ unalias sed
    $ sed s/foo/bar/ <<<foo
    bar

Happy hacking,
~ Luke Shumaker
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.