A comprehensive collection of reusable bash functions and scripts for common DevOps and system administration tasks, designed to make shell scripting more efficient and maintainable.
- Modular design for easy integration
- Reusable functions for common operations
- Well-documented code with examples
- Cross-platform compatibility
- Easy installation and setup
- Docker-based development environment
- Comprehensive DevOps tool integration
- Docker (20.10.0 or higher)
- Git
- Basic Shell Scripting knowledge
- Development Environment (VS Code, Vim, etc.)
- OS: Linux, macOS, or Windows with WSL2
- CPU: 2+ cores recommended
- RAM: 4GB minimum, 8GB recommended
- Storage: 10GB free space minimum
- Network: Stable internet connection
curl -sSL https://raw.githubusercontent.com/hperezrodal/bash-library/main/install-remote.sh | bash
If you're using zsh on macOS, you'll need to add the following to your ~/.zshrc
file:
# Add bash-library to your PATH
export PATH="$PATH:/path/to/bash-library"
# Source the library
source /path/to/bash-library/lib-loader.sh
After adding these lines, reload your zsh configuration:
source ~/.zshrc
- Clone the repository:
git clone https://github.com/hperezrodal/bash-library.git
cd bash-library
- Run the installation script:
./install.sh
sudo ./uninstall.sh
curl -sSL https://raw.githubusercontent.com/hperezrodal/bash-library/main/uninstall-remote.sh | bash
For zsh users, remove the bash-library related lines from your ~/.zshrc
file and run:
source ~/.zshrc
After uninstallation, you may need to restart your shell or run source ~/.zshrc
for changes to take effect.
bash-library/
├── modules/ # Core function modules
├── scripts/ # Utility scripts
├── examples/ # Usage examples
├── lib-loader.sh # Main functions file
├── install.sh # Installation script
├── uninstall.sh # Uninstallation script
├── build.sh # Docker build script
└── CONTRIBUTING.md # Contribution guidelines
To use the library in your scripts, source the main functions file:
source /path/to/bash-library/lib-loader.sh
The library provides several modules with common functions:
- AWS Operations (
aws.sh
): Functions for AWS-related operations
The library provides the following utility scripts:
- AWS Secrets Management (
aws-secrets.sh
): Script for managing AWS secrets
After installation, scripts are automatically made available in your system's PATH. You can use them in two ways:
-
Direct Execution
# Run the script directly aws-secrets --help
-
Sourcing in Your Script
# Source the script to use its functions source /path/to/bash-library/scripts/aws-secrets.sh
Each script includes built-in help documentation. To view available options and usage:
aws-secrets --help
# Using AWS secrets script
aws-secrets get-secret my-secret-name
Check out the examples/
directory for practical usage examples of the library functions.
Contributions are always welcome! Please read the contribution guidelines first.
MIT License - See LICENSE file for details
Made with ❤️ by hperezrodal