Rubriques
Description
Just a first example script, to understand how DjeShellSteps works. This example has 3 steps.
example1.sh
#!/bin/bash
############################################################
# File: example1.sh #
# Author: Jerome DESMOULINS - djeshellstepsATdesmoulins.fr #
# Description: #
# DjeShellSteps example 1: sample shell script #
# with 3 steps. #
############################################################
### Initialisation for environnement variables mandatory for DjeShellSteps ###
. `dirname $0`/djeshellsteps.sh
### Beginning of Shell Script ###
BeginSteps
echo "Starting Shell Script..."
### Step 10 ###
Step 10 "List all files on current directory"
if [ $RunThisStep -eq 1 ]; then
ls
fi
### Step 20 ###
Step 20 "Sleep for two seconds"
if [ $RunThisStep -eq 1 ]; then
sleep 2
fi
### Step 30 ###
Step 30 "Display kernel version"
if [ $RunThisStep -eq 1 ]; then
uname -a
fi
### End of Shell Script ###
EndSteps
[html]</pre>[/html]
[/block]#Description[/title]
Just a first example script, to understand how DjeShellSteps works.
This example has 3 steps.
[title=1]example1.sh[/title]
[block]
[html]<pre class="brush: bash;">[/html]
#!/bin/bash
############################################################
# File: example1.sh #
# Author: Jerome DESMOULINS - djeshellstepsATdesmoulins.fr #
# Description: #
# DjeShellSteps example 1: sample shell script #
# with 3 steps. #
############################################################
### Initialisation for environnement variables mandatory for DjeShellSteps ###
. `dirname $0`/djeshellsteps.sh
### Beginning of Shell Script ###
BeginSteps
echo "Starting Shell Script..."
### Step 10 ###
Step 10 "List all files on current directory"
if [ $RunThisStep -eq 1 ]; then
ls
fi
### Step 20 ###
Step 20 "Sleep for two seconds"
if [ $RunThisStep -eq 1 ]; then
sleep 2
fi
### Step 30 ###
Step 30 "Display kernel version"
if [ $RunThisStep -eq 1 ]; then
uname -a
fi
### End of Shell Script ###
EndSteps