It's official now; Solaris sh is brain dead...

For example, this program

    #!/bin/sh

    die() { echo die called with $1; exit 1; } >&2

    die foo
    die bar

will print *both* those messages!

I honestly don't care if this is posix or not, but it is BRAIN DEAD for
the ">&2" to change the meaning from {} to ()

Oh and the grep thing is even worse.

    echo foo | grep ^/

works fine in an interactive shell but in a script it attempts to
*execute* "/", complains, while simultaneously complaining about usage
of grep.

It's almost like it's treating ^ like |
This commit is contained in:
Sitaram Chamarty 2011-10-20 15:40:17 +05:30
parent f050938171
commit 5a125fac96
4 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
die() { echo "$@"; exit 1; } >&2
die() { echo "$@" >&2; exit 1; }
[ -z "$GL_RC" ] && die "ENV GL_RC not set"
[ -z "$GL_BINDIR" ] && die "ENV GL_BINDIR not set"