Does running exec echo "some "; echo "test"
in bash never print "some test"?
I would seek confirmation to this question, as I am writing a small shell script and I would like it to not contiue anything after the exec
command has been called.
I think that I would not need to worry, as my understanding, after consulting:
man 3 exec
man 1p exec
The shell scripts, when executed by the shell will make
- the shell execute the program
exec
, which - uses the
exec***
family system calls that replace the shell/bash that which has been executing the script, by this impeding further actions of the shell (which was "replaced")
As laid out before, main goal of this question is to seek confirmation for my reasoning as to prevent that anything in the script occuring after the exec (such as echo test
) would be executed.
I would appreciate a general answer (POSIX), as far as possible, but just in case of particularities I am most interested in GNU/Linux and GNU/Bash