[ET Trac] [Einstein Toolkit] #236: GetComponents should abort on undefined variables

Einstein Toolkit trac-noreply at einsteintoolkit.org
Wed Feb 2 22:19:01 CST 2011


#236: GetComponents should abort on undefined variables
----------------------------+-----------------------------------------------
  Reporter:  knarf          |       Owner:  eric9   
      Type:  defect         |      Status:  accepted
  Priority:  minor          |   Milestone:          
 Component:  GetComponents  |     Version:          
Resolution:                 |    Keywords:          
----------------------------+-----------------------------------------------

Comment (by eric9):

 Ok, I see what's going on here. Since $ARR is not defined, !GetComponents
 treats it as a legitimate directory name and attempts to check the thorns
 into Cactus/$ARR/xxx. Then the shell obviously decides that $ARR is not
 defined and gets rid of it, so I end up with Cactus/xxx. This presents an
 interesting problem because, technically, '$ARR' is a valid directory
 name, although I doubt that anyone actually names their folders like that.

 So I see two possible solutions:

 1. Force the $ sigil to indicate a variable and throw an error if it was
 not previously defined. This would be very clean and prevent issues of the
 type you saw; however, if someone happens to prefix some folders with a $,
 they would be out of luck...

 2. Allow the $ sigil to be used NOT referring to a variable. Any paths of
 this type would have to be explicitly single-quoted; this could probably
 be handled by !GetComponents itself though. I think I could just add some
 logic to automatically enclose any paths in single-quotes before executing
 a command, which should change nothing outside of odd cases like this.

 Since this would mean altering the behavior of !GetComponents, we should
 probably ask for comments on the mailing list as well.

 What do you think?

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/236#comment:3>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list