| 1 |
# This is a data file loaded by a script. |
| 2 |
# Files of this type may contain variables, functions, etc. |
| 3 |
# It loads with a 'source' or '.' command from a shell script. |
| 4 |
|
| 5 |
# Let's initialize some variables. |
| 6 |
|
| 7 |
variable1=23 |
| 8 |
variable2=474 |
| 9 |
variable3=5 |
| 10 |
variable4=97 |
| 11 |
|
| 12 |
message1="Greetings from *** line $LINENO *** of the data file!" |
| 13 |
message2="Enough for now. Goodbye." |
| 14 |
|
| 15 |
print_message () |
| 16 |
{ # Echoes any message passed to it. |
| 17 |
|
| 18 |
if [ -z "$1" ] |
| 19 |
then |
| 20 |
return 1 # Error, if argument missing. |
| 21 |
fi |
| 22 |
|
| 23 |
echo |
| 24 |
|
| 25 |
until [ -z "$1" ] |
| 26 |
do # Step through arguments passed to function. |
| 27 |
echo -n "$1" # Echo args one at a time, suppressing line feeds. |
| 28 |
echo -n " " # Insert spaces between words. |
| 29 |
shift # Next one. |
| 30 |
done |
| 31 |
|
| 32 |
echo |
| 33 |
|
| 34 |
return 0 |
| 35 |
} |