couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noah Slater (JIRA)" <>
Subject [jira] Created: (COUCHDB-169) POSIX shell incompatibilities
Date Wed, 03 Dec 2008 16:15:44 GMT
POSIX shell incompatibilities 

                 Key: COUCHDB-169
             Project: CouchDB
          Issue Type: Bug
          Components: Infrastructure
         Environment: Solaris
            Reporter: Noah Slater
            Assignee: Noah Slater

> 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:
> 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.                                                                      

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

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message