user66854
user66854

Reputation: 875

Need Help Running a Shell Script in IBM AIX

we have a shell script which we are trying to run as $>./shell.sh. On running this we get a error about a "bad interpreter". on running the script as sh shell.sh it runs. my question is can we run a shell script in IBM AIX as ./shell.sh.

we have a lot of shell scripts which call other scripts. changing the shell scripts to call the other shell scripts as sh other_shell_scripts.sh is not feasible.

note we are using the bash shell as the default shell

Upvotes: 0

Views: 8620

Answers (1)

l0b0
l0b0

Reputation: 58928

If you want to run a script with ./shell.sh it must have a shebang line as the first line, for example #!/usr/bin/env bash or #!/bin/sh.

If you do have a shebang line, check that it's correctly formatted and that your files do not contain DOS newlines (\r\n, aka CRLF). You can use dos2unix to fix such files.

Upvotes: 3

Related Questions