I have a function err() in file abc. The files do not have a .sh extension, but they start with #!/bin/bash.
err()
abc
.sh
#!/bin/bash
You need to export newly created functions
at end of abc add this:
export -f err