I am trying to merge multiple linux commands in one line to perform deployment operation. For example
cd /my_folder
rm *.jar
svn co path to repo
mvn compile package install
I am trying to merge multiple linux commands in one line to perform deployment operation. For example
cd /my_folder
rm *.jar
svn co path to repo
mvn compile package install
You can use as the following code;
It works...
To run them all at once, you can use the pipe line key "|" like so:
I've found that using ; to separate commands only works in the foreground. eg :
cmd1; cmd2; cmd3 &
- will only executecmd3
in the background, whereascmd1 && cmd2 && cmd3 &
- will execute the entire chain in the background IF there are no errors.To cater for unconditional execution, using parenthesis solves this :
(cmd1; cmd2; cmd3) &
- will execute the chain of commands in the background, even if any step fails.