Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-169

POSIX shell incompatibilities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 0.9
    • Infrastructure
    • None
    • Solaris

    Description

      > My local "checkbashisms" doesn't seem to complain at all. The [ ... ] syntax is just a shortcut for "test" and I would prefer to avoid it if possible. Could you check for me that using "test expr" wouldn't work in its place.

      No, "test expr" doesn't work. After test you can only have arguments to test, not shell expressions. It is possible of course to do:

      if test `echo 2> /dev/null >> $PID_FILE; echo $?` -gt 0; then

      For proof, see the man page: http://docs.sun.com/app/docs/doc/816-5165/test-1?l=en&q=man&a=view

      > This seems reasonable, though checkbashisms doesn't report anything.
      >
      > I am wondering if your Solaris shell is POSIXly correct. Could you provide me with a pointer to its manual, please?

      It doesn't get more POSIX than Solaris .

      $ /bin/sh
      $ echo $(echo yes)
      syntax error: `(' unexpected

      Here is the man page. Note that the "Command substitution" section doesn't mention anything about $() syntax.

      http://docs.sun.com/app/docs/doc/816-5165/sh-1?l=en&q=man&a=view

      You may want to have a our collaborative notes over there:

      Attachments

        Activity

          People

            nslater Naomi Slater
            nslater Naomi Slater
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: