Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
head -c-2 doesn't work on macOS, is the intent to get the first string of alphanumerics out of the URL? I guess sed 's/[^0-9]*//;s/[^0-9].*//' would do that in a single process. Of course, using parameter expansion would do it without any external process at all (but require several steps and maybe a temporary variable).
Unfortunately, the Bitbucket link only has limited functionality (and even that requires you to enable JavaScript). The documentation link in the README is another 404; similarly, the code contains doc strings which link to this now-defunct location. By and large, this seems unmaintained and undocumented.