Skip to content

Unstructured experiments to learn about creating Bash builtins in C.

License

Notifications You must be signed in to change notification settings

cjungmann/bash_builtin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bash Builtins Project

Introduction

I wanted to play around with Bash builtins when I realized that they had special characteristics I could exploit for improving performance in some of my more ambitious scripts. Unable to find much in the way of documentation, I downloaded the Bash source code and referred to the standard builtins while I started experiments.

I was happy to find that builtins did indeed deliver what I had hoped: that a C program could run in the same process as Bash script, and a C program could call back to a function in the script.

There are several details to which one must attend in order to develop a working Bash builtin. To avoid missing any of the details, I created a template with skeletal source files and a Makefile. The basic template spawned several more targeted templates. The last template, basic_handle, continues to get attention as I add tools and other code.

Prerequisite

The Bash-Builtin headers must be installed in order to compile the examples.

sudo apt-get install bash-builtins

Development Phases

The project preserves two phases of development, the experimental phase consisting of several small projects, and a ongoing phase of developing templates that can jump-start new projects.

Phase 1: Experimentation

The README document of the experimental phase is the original project README file. It lists the source files and their learning objectives, and describes how to build and test them.

The files of the experimentation phase are found in the main project directory.

Phase 2: Templates

The experiment phase of the project is mostly complete. The experiments are found in the main project directory and are described in the README file.

About

Unstructured experiments to learn about creating Bash builtins in C.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published