Home Linux Bash
Allows you to resume a script if you expect possible failures. 

#!/bin/bash

mStepMin=${1:-1}
mStepMax=3

step_1()
{
  echo "##"
  echo "## Step 1"
  echo "##"
  echo ""
} 

step_2()
{
  echo "##"
  echo "## Step 2"
  echo "##"
  echo ""

} 

step_3()
{
  echo "##"
  echo "## Step 3"
  echo "##"
  echo ""

} 

echo "Starting at step: " $mStepMin

for mStep in $(seq $mStepMin $mStepMax)
do 
  step_$mStep
done