Skip to content
This repository

Shell libraries to help writting shell script

branch: master
Octocat-spinner-32 tests Update CLI testcases towars cli and cli-help changes
Octocat-spinner-32 AUTHOR Add AUTHOR and CONTRIBUTOR files
Octocat-spinner-32 CONTRIBUTORS Add AUTHOR and CONTRIBUTOR files
Octocat-spinner-32 COPYING initial commit
Octocat-spinner-32 INSTALL - script ScriptHelper.conf file, which has to be put in /etc/ if you …
Octocat-spinner-32 README update README adding lock.lib.sh and mutex.lib.sh
Octocat-spinner-32 ScriptHelper.conf add SCRIPT_HELPER_VERSION variable in configuration file
Octocat-spinner-32 ask.lib.sh bugfix ASK when you have $ in the question
Octocat-spinner-32 cli-help.lib.sh - bugfix CLI_RUN() : better check of existance of added command (quit…
Octocat-spinner-32 cli.lib.sh - bugfix CLI_RUN() : better check of existance of added command (quit…
Octocat-spinner-32 conf.lib.sh bugfix CONF_LOAD called with empty string
Octocat-spinner-32 date.lib.sh BugFix: format selection in DATE_AGO()
Octocat-spinner-32 exec.lib.sh BugFix : parsing and quote of command in EXEC()
Octocat-spinner-32 lock.lib.sh - fix issue #3 : replace all 'echo' by 'printf'
Octocat-spinner-32 mail.lib.sh - fix issue #3 : replace all 'echo' by 'printf'
Octocat-spinner-32 message.lib.sh bugfix BR(), as we are using printf now
Octocat-spinner-32 mutex.lib.sh use 'ps -p' instead of 'ps -A | grep'
Octocat-spinner-32 mysql.lib.sh esthetic : remove trailing whitespaces
Octocat-spinner-32 random.lib.sh Header esthetism
Octocat-spinner-32 record.lib.sh bugfix cleaning time file + clean temp file in testcase
Octocat-spinner-32 template.lib.sh - fix issue #3 : replace all 'echo' by 'printf'
README
== Welcome to ScriptHelper

ScriptHelper is a POSIX shell library of common functions, to facilitate code reuse.

First, I've wrote ScriptHelper to be able to send bash script to other users and
always know what's wrong when they failed. This was the purpose of the CMD command,
which role is to exec a command, log stdout & stderr, and check the return status.

Then, I've added some functions, I wrote several times.

== Description of contents

*.lib.sh : library files
tests/* : test files

Each file have description of their functions, usage, options, etc..

== List of libraries

I try to make one lib for each purpose :
 - message.lib.sh : messaging functions.
 - exec.lib.sh    : execute commands, check the return code, Rollback feature
 - ask.lib.sh     : usefull when you have to ask question to the user
 - cli.lib.sh     : create easily Command Line Interface for interactive scripts
 - conf.lib.sh    : deal with configuration file (where data are stored with key=value format)
 - lock.lib.sh    : take a resource by locking it
 - mail.lib.sh    : to prepare and send mails
 - mutex.lib.sh   : mutex for allocating resource
 - mysql.lib.sh   : to make mysql scripts
 - random.lib.sh  : random number generator
 - record.lib.sh  : record tty session

== Install

read INSTALL file

== Usage

ScriptHelper is used in those projects :
 - Tosca (http://tosca-project.net/) - deployment scripts
 - sshGate (http://github.com/Tauop/sshGate) - ssh proxy in bash
 - ScriptCollection (http://github.com/Tauop/ScriptCollection) - little script to make specify tasks
Something went wrong with that request. Please try again.