How to fix Avamar 'spawn after execve errno:8 Exec format error'

Avamar

When running pre/post scripts, it is possible that you are getting the following error message:

2017-03-20 19:43:43 avtar Info <5916>: Executing run-at-start '/usr/local/avamar/etc/scripts/test.sh'
2017-03-20 19:43:43 avtar Info <6033>: Begin STDERR from run-at-start:
avspawn::spawn after execve errno:8 code 8: Exec format error

In order to resolve this, ensure that you specify the interpreter as the first line.
So it should start with, for example:

#!/bin/sh