# bsfl **Repository Path**: fengjihu/bsfl ## Basic Information - **Project Name**: bsfl - **Description**: Bash Shell Function Library 是一个短小精炼的 Bash 公共库,他提供了诸如数组操 作、命令执行、文件管理、日志记录、信息提醒、网络检测、字符操作、时间操作、变量 操作等功能,帮助运维工程师快速完成自己的脚本编写工作。 在线文档:https://skyplabs.github.io/bsfl/modules.html - **Primary Language**: Shell - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-29 - **Last Updated**: 2021-10-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # BSFL [![Build Status](https://travis-ci.org/SkypLabs/bsfl.svg?branch=master)](https://travis-ci.org/SkypLabs/bsfl) The Bash Shell Function Library (BSFL) is a small bash script that acts as a library for bash scripts. It provides a couple of functions that makes the lives of most people using shell scripts a bit easier. This project is a fork of the original work of Louwrentius. ## Getting started In order to use BSFL, you have to include the library in your bash scripts. You can do it with an absolute path : source For example : source /opt/bsfl/bsfl.sh Or with a relative path : declare -r DIR=$(cd "$(dirname "$0")" && pwd) source $DIR/ For example : declare -r DIR=$(cd "$(dirname "$0")" && pwd) source $DIR/../lib/bsfl.sh ## What's next ? The best way to learn how BSFL works is to look at the examples available in the [examples][2] folder. ## Documentation The online documentation is available [here][3]. Building the documentation is done by using [Doxygen][5] : cd /doc doxygen Doxyfile ## Dependencies BSFL is implemented for bash version 4. Prior versions of bash will fail at interpreting its code. In addition, BSFL depends of some external programs. Here is the list of these programs : * tr * logger * date * tput * grep * printf * sed However, we try to get as much as possible a standalone library. Hence, some of these external dependencies will be removed in the future. ## Unit tests BSFL uses [Bats][4] testing framework to verify the correct behaviour of its functions. To run all the tests : bats /test Or, to run only the tests of a specific group : bats /test/ For example, for the network group : bats /test/network.bats ## Get involved ! This project is still under development. Contributions are welcomed. ## License [New BSD][1] [1]: http://opensource.org/licenses/BSD-3-Clause [2]: https://github.com/SkypLabs/bsfl/tree/master/examples [3]: http://skyplabs.github.io/bsfl [4]: https://github.com/sstephenson/bats [5]: http://doxygen.org/