[parsec-users] Small bug in env.sh

Amittai Aviram amittai.aviram at yale.edu
Mon May 14 17:57:05 EDT 2012


Every time I would run "source env.sh," I would get this error message:

dirname: invalid option -- 'b'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.

The script would otherwise work in setting the environment variables correctly, but the error message was annoying.  I finally found out why error happens--see this page:

http://lists.gnu.org/archive/html/bug-coreutils/2011-04/msg00037.html

To correct this behavior, I had to insert "--" after each instance of "${xxDIRNAMExx}."  I would like to suggest this change for future releases of PARSEC.  Below by signature is a suggested patch (env.sh.patch).
Amittai Aviram
PhD Student in Computer Science
Yale University
646 483 2639
amittai.aviram at yale.edu
http://www.amittai.com

--- env.sh      2012-05-14 17:40:12.250491791 -0400
+++ env_new.sh  2012-05-14 17:31:43.697577348 -0400
@@ -37,14 +37,14 @@
     # Try to extract absoute or relative path
     if [ "${0:0:1}" == "/" ]; then
       # Absolute path given
-      eval xxparsecdirxx=$(${xxDIRNAMExx} $(${xxDIRNAMExx} $0))
+      eval xxparsecdirxx=$(${xxDIRNAMExx} -- $(${xxDIRNAMExx} -- $0))
       # Check
       if [ -f "${xxparsecdirxx}/${xxuniquefilexx}" ]; then
         xxPARSECDIRxx=${xxparsecdirxx}
       fi
     else
       # No absolute path, maybe relative path?
-      eval xxparsecdirxx=$(${xxPWDxx})/$(${xxDIRNAMExx} $(${xxDIRNAMExx} $0))
+      eval xxparsecdirxx=$(${xxPWDxx})/$(${xxDIRNAMExx} -- $(${xxDIRNAMExx} -- $0))
       # Check
       if [ -f "${xxparsecdirxx}/${xxuniquefilexx}" ]; then
         xxPARSECDIRxx=${xxparsecdirxx}



More information about the parsec-users mailing list