Download Latest Version Help4ShellScript_1_0_0.tar.gz (14.0 kB)
Email in envelope

Get an email when there's a new version of Help4ShellScript

Home
Name Modified Size InfoDownloads / Week
README.txt 2018-10-01 2.7 kB
Help4ShellScript_1_0_0.tar.gz 2018-10-01 14.0 kB
Totals: 2 Items   16.7 kB 0
# 00_README.txt -- This file is part of Help4ShellScript.
#
# Copyright (C) 2018 Jun Inamori
#
# Help4ShellScript is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Help4ShellScript is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.
# If not, see http://www.gnu.org/licenses/.
# Or, write to the Free Software Foundation, Inc., 51 Franklin Street,
# Fifth Floor, Boston, MA 02110-1301, USA.
#


---------------------------------------
$. Where is it?

The main shell script of this tool is:
   11_shell/help.sh


---------------------------------------
$. What it does?

While writing the shell script, we often write the repeated lines of:
   echo "message"
This is one of the most tedious tasks in the shell scripting.

By this tool ...
1) We can write the text messages into the plain text.
2) From that text file, our shell script can grab and print the required text fragment.


---------------------------------------
$. Preparation

The shell script and the text file must have the same file name, except the file extension.
For instance, when we are writing the shell script whose name is:
   sample.sh
then the text file for its messages should be:
   sample.txt

In the text file, we can write the several text messages.
And those text messages should be divided by:
================ dividing line ================


---------------------------------------
$. How to call it

To print the first text message, we should write:
. ./help.sh help 1
within:
   sample.sh
Then, "help.sh" parses:
   sample.txt
and prints the first group of lines divided by:
================ dividing line ================

To print the second text message, we should write:
. ./help.sh help 2
within:
   sample.sh

---------------------------------------
$. help message of the shell script

The short hand of:
. ./help.sh help 1
is:
. ./help.sh help

This is convenient for the case when we want to print the help message for the shell script.
For instance, within the first few lines of:
   sample.sh
we can put the line like:
. ./help.sh ${1}
And the we can write the help message into the first section within:
   sample.txt
Then, the user can type:
   sample.sh help
to see the help message.
Source: README.txt, updated 2018-10-01