Why does my shell script hang without the .sh extension?
Solution 1:
suspend
is a bash builtin,
suspend: suspend [-f]
Suspend shell execution.
Suspend the execution of this shell until it receives a SIGCONT signal.
Unless forced, login shells cannot be suspended.
Options:
-f force the suspend, even if the shell is a login shell
Exit Status:
Returns success unless job control is not enabled or an error occurs.
and as builtins take precedence, just typing suspend
would behave exactly as you describe: the shell blocks until you kill it (if you kill -CONT
it, it resumes).
That you're seeing this same behavior by invoking it with the path is either an experimental error, or a bug in the shell. I'd suspect the former before the latter.
Solution 2:
If you want your command to supercede a builtin, you first have to disable the builtion:
enable -n suspend
You can then run your command like a normal command. Then, you re-enable the builtin
enable suspend
I'm surprised the builtin is invoked when you call your command with the full path.