dserodio + bash   16

dylanaraps/pure-bash-bible: 📖 A collection of pure bash alternatives to external processes.
The goal of this book is to document known and unknown methods of doing various tasks using only built-in bash features. Using the snippets from this bible can help to remove unneeded dependencies from scripts and in most cases make them that little bit faster.
bash  scripting 
june 2018 by dserodio
cv/sd: A tool to keep utility scripts neatly organized.
A tool to keep utility scripts neatly organized.

sd scans and provides completion for a nested tree of executable script files.
cli  commandline  bash 
april 2018 by dserodio
vorakl/TrivialRC: A minimalistic RC system and process manager for containers and applications
The minimalistic Run-time Configuration (RC) system and process manager is written in pure BASH and uses just a few external utilities like ls, ps, date and sleep. Minimally, installation of TrivialRC consists of only one file which can be downloaded directly from the Github. Originally, it was designed for use in containers but it also can be well used for running a group of processes asynchronously and synchronously, as well as managing their running order and exit codes.
bash  docker  shell 
august 2017 by dserodio
arpinum-oss/shebang-unit: Automated test framework for Bash
shebang-unit is an automated testing framework for Bash 4 based on xUnit.

With shebang-unit you can :

assert equality,
assert that string contains or not another string,
assert that array contains or not an element,
assert that status code is success or failure,
assert that command is successful or failing,
write setup or teardown functions for a test or a whole test file,
mock functions to speed up tests or enhance reliability,
view tests results with different kind of reports,
randomly execute tests to verify isolation,
save a baby kitten every time you use it!

Now you don't have any excuse for not practicing some sexy Test-Driven Development in Bash.
bash  scripting  testing 
may 2017 by dserodio
GitHub - sstephenson/bats: Bash Automated Testing System
Bats is a TAP-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write behave as expected.

A Bats test file is a Bash script with special syntax for defining test cases. Under the hood, each test case is just a function with a description.

Bats is most useful when testing software written in Bash, but you can use it to test any UNIX program.

Test cases consist of standard shell commands. Bats makes use of Bash's errexit (set -e) option when running test cases. If every command in the test case exits with a 0 status code (success), the test passes. In this way, each line is an assertion of truth.
from:ifttt  development  testing  bash  shell 
april 2017 by dserodio
Advancing in the Bash Shell – ${me:-whatever}
If you’ve ever used GNU/Linux, chances are good that you’ve used bash. Some people hold the belief that using a GUI is faster than using a CLI. These people have obviously never seen someone who uses a shell proficiently. In this tutorial, I hope to show you just a few of the amazing features bash provides that will increase your productivity in the shell.
bash  unix  shell  linux  cli  commandline 
september 2016 by dserodio
sh documentation
sh (previously pbs) is a full-fledged subprocess interface for Python that allows you to call any program as if it were a function:
bash  python  shell 
july 2016 by dserodio
Debugging a script [Bash Hackers Wiki]
These few lines are not intended as a full-fledged debugging tutorial, but as hints and comments about debugging a Bash script.
bash  debug  debugging  scripting  shell 
july 2016 by dserodio
BashGuide - Greg's Wiki
This guide is targeted at beginning users. It assumes no advanced knowledge -- just the ability to login to a Unix-like system and open a command-line (terminal) interface. It will help if you know how to use a text editor; we will not be covering editors, nor do we endorse any particular editor choice. Familiarity with the fundamental Unix tool set, or with other programming languages or programming concepts, is not required, but those who have such knowledge may understand some of the examples more quickly.
bash  linux  shell  tutorial 
march 2016 by dserodio
Use the Unofficial Bash Strict Mode (Unless You Looove Debugging)
Let's start with the punchline. Your bash scripts will be more robust, reliable and maintainable if you start them like this:

set -euo pipefail

I call this the unofficial bash strict mode. This causes bash to behave in a way that makes many classes of subtle bugs impossible. You'll spend much less time debugging, and also avoid having unexpected complications in production.

There is a short-term downside: these settings make certain common bash idioms harder to work with. They all have simple workarounds, detailed below: jump to Issues & Solutions. But first, let's look at what these obscure lines actually do.
bash  scripting  shell  unix 
june 2015 by dserodio
Rich’s sh (POSIX shell) tricks
This page is meant as a repository for useful tricks I’ve found (and some I’ve perhaps invented) for scripting the POSIX shell (with some attention to portability to non-conformant shells as well, scattered here and there). I am a strong believer that Bourne-derived languages are extremely bad, on the same order of badness as Perl, for programming, and consider programming sh for any purpose other than as a super-portable, lowest-common-denominator platform for build or bootstrap scripts and the like, as an extremely misguided endeavor. As such you won’t see me spending many words on extensions particular to ksh, Bash, or whatever other shells may be popular.
bash  linux  programming  shell 
september 2014 by dserodio
The Bash Guide
This guide is an introduction to basic and advanced concepts of the bash shell.

It teaches both newcomers and long-time users the best, safest and most robust ways of writing powerful bash scripts as well as making efficient and speedy interactive use of the shell.

This guide has gone through several iterations and is the result of a severe lack of consistent, clear and reliable language on the topic on the rest of the Internet as well as the public library or book stores.
documentation  linux  programming  shell  bash 
august 2014 by dserodio

Copy this bookmark: