Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 13
    This works for bash version 4.2-alpha and above, too bad the version I have access to is earlier. :-/ Commented Jul 14, 2014 at 3:46
  • 4
    @iamaziz: From bash changelog, the negative length in ${var:offset:lenght} was added only in bash 4.2. Maybe OSX add its own patch for bash. Commented May 8, 2016 at 5:59
  • 2
    @cuonglm neither work :/ Commented May 8, 2016 at 6:59
  • 2
    Doesn't work on mac. Commented Aug 6, 2017 at 6:57
  • 2
    MACsters, look down to Russ's answer Commented Jun 21, 2018 at 1:55