NetBSD-Users archive

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

awk flea?



Hi,

it's a bit funny that awk tries to close /dev/stdin even in the
situation where stdin is not used at all:

        $ cat foo.sh
                #!/bin/sh

                foo() {
                        awk '' /etc/rc.conf
                }

                /bin/cat <<-EOF
                        $(foo)
                EOF
        $ ./foo.sh
                awk: i/o error occurred while closing /dev/stdin
                 source line number 1

        $

-awk '' /etc/rc.conf
+awk '' </etc/rc.conf

        $ cat foo.sh
                #!/bin/sh

                foo() {
                        awk '' </etc/rc.conf
                }

                /bin/cat <<-EOF
                        $(foo)
                EOF
        $ ./foo.sh

        $

Bug of feature?



   Petar Bogdanovic





Home | Main Index | Thread Index | Old Index