Skip to content
simon0302010Public

About

A bad shell written in C++

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

78 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BSH

Bsh (short for bad shell) is a simple shell made by me in C++. It supports basic features like pipes, redirections, environment variable expansion, script execution, and a colorful prompt.

Features

  • Command execution – Every shell can do this
  • A few built-in commands
  • Piping – Commands can be piped into each other by using |
  • File completion using TAB - Thanks to GNU Readline
  • stdout/stderr/stdin redirection using > >> 2> 2>> <
  • Env variable expansion – $VAR or ${VAR} will be expanded
  • Script execution – Put a few commands into a file and run it
  • Colored prompt – Nothing more to say about that
  • Command history – Lets you run commands from your history (also some other stuff but not enough space)
  • Displays the last exit code 🤯
  • Multiline commands using \ and separating commands using ;
  • Support for all kinds of wildcards
  • Environment variables
  • Configurable prompt via ~/.bshrc

Requirements

  • A computer
  • Linux

Installation from the AUR

If you're running an arch based distro, you can install bsh from the AUR:

yay -S bsh-git

You can also use any other AUR helper

Installation from source

  1. Install dependencies (example for Arch Linux):
    sudo pacman -S cmake base-devel fmt readline
  2. Clone the GitHub repository:
    git clone https://github.com/simon0302010/bsh.git
    cd bsh
  3. Build and install:
    cmake -B build -DCMAKE_INSTALL_PREFIX=/usr
    cmake --build build
    sudo cmake --install build

Usage

Just run bsh.

Notes

  • This shell is still in development, so expect bugs and missing features.
  • When the PATH environment variable is changed, the command changing it will take around 50ms more to execute due to the list of available commands being rebuilt.

License

This project is licensed under the GNU General Public License Version 3. For more information, see the LICENSE file.

About

A bad shell written in C++

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages