One rough way:
#!/bin/bash
[ "$1" = "--frest_start" ] && rm statusfile
touch statusfile
read status < statusfile
[ "$status" = "" ] && status=0
case $status in
0) ./script1; echo 1 > statusfile ;&
1) ./script2; echo 2 > statusfile ;&
2) ./script3; echo 3 > statusfile ;&
23) ./script24; echo 24 > statusfile ;;
esac
But doing it through Makefile
seems like a good solution too ...
.NOTPARALLEL
.PHONY: all frest_start
all:
make step1
make step2
make step3
....
make step24
step%: script%
"./$<"
touch "$@"
frest_start:
rm step*
make all
source
share