/bin/sh: error importing function definition for `some-function'

[edited after 1st comment from: @chepner - thanks!]

/bin/bash allows hyphens in function names, /bin/sh (Bourne shell) does not. Here, the offending "some-function" had been exported by bash, and bash called yum which called /bin/sh which reported the error above.

fix: rename shell functions to not have hyphens

man bash says that bash identifiers may consist: "only of alphanumeric characters and underscores"

The /bin/sh error is much more explicit:

some-function () { :; }

sh: `some-function': not a valid identifier


Change/Fix the function name from "foo-bar" to "foo_bar"

It is the naming convention that bash is ok with, where as sh is not.

Replace the "-"(hyphen/dash/minus) with "_"(underscore), and the error gets fixed, and the code works on both bash and sh