#17685: Wrong shell test for "sage -n=..."
-------------------------------------------------+-------------------------
       Reporter:  tmonteil                       |        Owner:
           Type:  defect                         |       Status:  closed
       Priority:  major                          |    Milestone:  sage-6.5
      Component:  scripts                        |   Resolution:  fixed
       Keywords:                                 |    Merged in:
        Authors:  Thierry Monteil                |    Reviewers:  François
Report Upstream:  N/A                            |  Bissey
         Branch:                                 |  Work issues:
  633f690b9d5c354529ae60b252360877a07e7c20       |       Commit:
   Dependencies:                                 |     Stopgaps:
-------------------------------------------------+-------------------------

Comment (by tmonteil):

 Replying to [comment:4 vdelecroix]:
 > Just by curiosity, why did you remove the `"`?

 If i put a global quote `"^-n=.*"`, then everything is escaped so `^` and
 `.*` will not be recognized as special characters (it will recognize
 strings containing the substring `^-n=.*`). So i would have to do
 `^"-n=".*` to only escape `-n=`. Now, looking at `man 7 regex`, it seems
 that `=` is special only if surrounded by some bracket, and `-` is special
 only for intervals like `A-Z`. So, since it is not the case, we should be
 safe without quotes (though i usually like to put lot of quotes in bash,
 just to be sure), hence i thought "if something goes wrong with that
 apparently less safe way, then it will be good because then we could help
 fixing bash."

 Replying to [comment:10 kcrisman]:
 > Nice work! If you wanted to remove the `=~` at the same time (see here)
 that would be swell, if no one would object to it (improves portability, I
 would think).

 It seems that i am a bit late, i did not think the ticket will be merged
 so fast. Actually, even `[[` is a bashism, not only `=~`, so it is indeed
 a good proposition to get rid of this construction. See #17699 for a
 follow up.

--
Ticket URL: <http://trac.sagemath.org/ticket/17685#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to