How to disable stopping a bash script from executing after calling some command?

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am trying to create a bash script to deploy an application. Prior to deploying, the application must be built using maven. The problem is, once the maven build finishes, the next command is never called. It seems like maven issues some signal to terminate any further execution.
E.g. in the following script, the Hello world is never written to standard output.
#!/bin/sh
exec mvn -DskipTests -Darguments=-DskipTests clean install
echo "Hello world"
Is there a way how to go around this limitation?
bash shell-script maven
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
I am trying to create a bash script to deploy an application. Prior to deploying, the application must be built using maven. The problem is, once the maven build finishes, the next command is never called. It seems like maven issues some signal to terminate any further execution.
E.g. in the following script, the Hello world is never written to standard output.
#!/bin/sh
exec mvn -DskipTests -Darguments=-DskipTests clean install
echo "Hello world"
Is there a way how to go around this limitation?
bash shell-script maven
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Omit theexec?
â dsstorefile1
1 min ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am trying to create a bash script to deploy an application. Prior to deploying, the application must be built using maven. The problem is, once the maven build finishes, the next command is never called. It seems like maven issues some signal to terminate any further execution.
E.g. in the following script, the Hello world is never written to standard output.
#!/bin/sh
exec mvn -DskipTests -Darguments=-DskipTests clean install
echo "Hello world"
Is there a way how to go around this limitation?
bash shell-script maven
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am trying to create a bash script to deploy an application. Prior to deploying, the application must be built using maven. The problem is, once the maven build finishes, the next command is never called. It seems like maven issues some signal to terminate any further execution.
E.g. in the following script, the Hello world is never written to standard output.
#!/bin/sh
exec mvn -DskipTests -Darguments=-DskipTests clean install
echo "Hello world"
Is there a way how to go around this limitation?
bash shell-script maven
bash shell-script maven
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 3 mins ago
Andy
1061
1061
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Omit theexec?
â dsstorefile1
1 min ago
add a comment |Â
Omit theexec?
â dsstorefile1
1 min ago
Omit the
exec?â dsstorefile1
1 min ago
Omit the
exec?â dsstorefile1
1 min ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Just remove the exec from your command line calling Maven.
The exec command replaces the shell with the command being executed, so the shell is no longer around and won't execute anything after that line (well, except if executing that command fails.)
If you want the shell around, just don't use exec for spawning external commands.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Just remove the exec from your command line calling Maven.
The exec command replaces the shell with the command being executed, so the shell is no longer around and won't execute anything after that line (well, except if executing that command fails.)
If you want the shell around, just don't use exec for spawning external commands.
add a comment |Â
up vote
1
down vote
Just remove the exec from your command line calling Maven.
The exec command replaces the shell with the command being executed, so the shell is no longer around and won't execute anything after that line (well, except if executing that command fails.)
If you want the shell around, just don't use exec for spawning external commands.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Just remove the exec from your command line calling Maven.
The exec command replaces the shell with the command being executed, so the shell is no longer around and won't execute anything after that line (well, except if executing that command fails.)
If you want the shell around, just don't use exec for spawning external commands.
Just remove the exec from your command line calling Maven.
The exec command replaces the shell with the command being executed, so the shell is no longer around and won't execute anything after that line (well, except if executing that command fails.)
If you want the shell around, just don't use exec for spawning external commands.
answered 29 secs ago
Filipe Brandenburger
4,7351623
4,7351623
add a comment |Â
add a comment |Â
Andy is a new contributor. Be nice, and check out our Code of Conduct.
Andy is a new contributor. Be nice, and check out our Code of Conduct.
Andy is a new contributor. Be nice, and check out our Code of Conduct.
Andy is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479615%2fhow-to-disable-stopping-a-bash-script-from-executing-after-calling-some-command%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Omit the
exec?â dsstorefile1
1 min ago