I have two files which I have to compile. I want to write something like an event based shell script which compiles first file and then the second file. Is it possible to write event based shell script that does action 2 when action 1 is completed.
Asked
Active
Viewed 248 times
0
-
Look into http://stackoverflow.com/questions/2847730/c-build-systems – RedX Mar 18 '13 at 13:30
2 Answers
2
That thing is called make
and it allows you to define targets, dependencies and rules.

Michael Wild
- 24,977
- 3
- 43
- 43
1
Yes, just like this:
#!/bin/sh
action1
action2

tomsv
- 7,207
- 6
- 55
- 88
-
-
`action1 && action2` will perform the 2nd only if the 1st succeeds – glenn jackman Mar 18 '13 at 14:01
-
@AndyT try set -o errexit and it will stop execution if there is an error. – tomsv Mar 18 '13 at 16:22