Skip to content

Commit

Permalink
Merge pull request #5 from dr8co/main
Browse files Browse the repository at this point in the history
Minor updates
  • Loading branch information
dr8co authored Feb 17, 2023
2 parents b0a54a4 + 6409fea commit ad9f188
Show file tree
Hide file tree
Showing 23 changed files with 83 additions and 84 deletions.
81 changes: 40 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# The Burning Bush: A simple UNIX command interpreter
<h1 align="center">The Burning Bush</h1>
<h2 align="center">A simple UNIX command interpreter</h2>

![The Burning Bush](./media/mother-earth-burning.gif "Mother Earth Burning Sticker")
<p align="center">
<img alt="The Burning Bush" src="./media/mother-earth-burning.gif" title="Mother Earth Burning Sticker" width="491" height="495"/>
</p>

## Table of Content
## Table of Contents

* [About](#introduction)
* [Installation](#installation)
* [Requirements](#requirements)
* [How to install](#how-to-install)
* [Requirements](#requirements)
* [How to install](#how-to-install)
* [Usage](#usage)
* [Supported Commands](#supported-commands)
* [Other features](#other-features)
* [Uninstallation](#uninstallation)
* [Supported Commands](#supported-commands)
* [Other features](#other-features)
* [Examples](#examples)
* [Uninstallation](#uninstallation)
* [Caveats](#caveats)
* [Acknowledgement](#acknowledgement)

Expand All @@ -34,11 +37,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
### Requirements

* **UNIX-like environment**, like macOS and Linux.
* GNU **GCC**, or **clang** LLVM compiler.
* GNU **GCC**, or LLVM **Clang** compiler.

### How to install

Run the install.sh script with root privileges to install:
Run the [installation script](./install.sh) with root privileges to install:

```zsh
sudo ./install.sh
Expand All @@ -51,8 +54,7 @@ Also, you can compile it on the command-line with
`-Wall -Werror -Wextra -pedantic` flags to generate warnings for potential issues/bugs.

Use option `-std=gnuXX` where `XX` can be `99`, `11`, `17` or `2x`, depending on the
latest version of C supported by your compiler
(it is advisable to compile with the latest stable standards).
latest version of C supported by your compiler.

For example,

Expand All @@ -69,7 +71,7 @@ mkdir -p ./cmake-bush

"$(command -v cmake)" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM="$(command -v ninja)" -G Ninja -S . -B ./cmake-bush

"$(command -v cmake)" --build ./cmake-bush --target bush -j 3
"$(command -v cmake)" --build ./cmake-bush --target bush -j 4

# You can now run
# cd cmake-bush/src && ./bush
Expand All @@ -89,36 +91,33 @@ Terminate with `exit`.
The Burning Bush supports all the standard UNIX commands (every program in PATH)
as well as a few builtin commands.

The builtins supported are:
The **builtins** supported are:

* `cd [directory]`\
Changes the shell working directory. With no argument
(or with `~` or `~/` arg), the working directory
is changed to $HOME.
`cd -` changes the working directory to the previous working directory.

* `echo [args]`\
Writes arguments to the standard output.
Changes the shell working directory. With no argument
(or with `~` or `~/` arg), the working directory
is changed to $HOME.
`cd -` changes the working directory to the previous working directory.

* `exit [status]`\
Exits the shell with status (0 by default or if called with no argument).
Exits the shell with status (0 by default or if called with no argument).

* `pwd`\
Prints the shell working directory.
Prints the shell working directory.

* `export [name[=value]]`\
Export attribute for shell variables.
Export attribute for shell variables.

* `history`\
Display history of commands.\
The `!` operator is also supported for executing
commands in the shell history. (eg `!!`, `!23`, `!3`).
Display history of commands.\
The `!` operator is also supported for executing
commands in the shell history. (eg `!!`, `!23`, `!3`).

* `help [command]`\
Displays help. `help command` displays help for `command`, where `command`
can be `cd`, `echo`, and `exit`. `help`.
Without any argument, (or with an invalid argument),
the general shell help is printed.
Displays help. `help command` displays help for `command`, where `command`
can be `cd`, `echo`, and `exit`. `help`.
Without any argument, (or with an invalid argument),
the general shell help is printed.

### Other Features

Expand All @@ -137,15 +136,6 @@ username@hostname:current_working_directory$
>
```

## Uninstallation

Run the uninstall.sh script with root privileges to uninstall
The Burning Bush from your system:

```zsh
sudo ./uninstall.sh
```

## Examples

```console
Expand Down Expand Up @@ -220,6 +210,15 @@ normal@prompt:bush$ echo $?
98
```

## Uninstallation

Run the [uninstallation script](./uninstall.sh) with root privileges to uninstall
The Burning Bush from your system:

```zsh
sudo ./uninstall.sh
```

## Caveats

* Command separators `;`, `||`, `&&` are not supported.
Expand All @@ -228,7 +227,7 @@ normal@prompt:bush$ echo $?

## Acknowledgement

Repository author: [Ian Duncan](https://github.com/dr8co "Ian")
Project author: [Ian Duncan](https://github.com/dr8co "Ian")

The **"Mother Earth Burning Sticker"** courtesy of [Tenor](https://tenor.com/ "Tenor")
and [INTO ACTION](https://tenor.com/official/intoaction "intoaction").
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ APP_PATH="/opt/burning_bush"
BIN_PATH="/usr/local/bin"
MAN_PATH="/usr/local/share/man/man1"

echo -e "Installing The Burning Bush..\n"
echo -e "Installing The Burning Bush 3.0 ..\n"

echo -e "Compiling..\n"

Expand Down
2 changes: 1 addition & 1 deletion man/burning-bush.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH man 1 "21 January 2023" "2.1" "The Burning Bush man page"
.TH man 1 "18 February 2023" "3.0" "The Burning Bush man page"
.SH NAME
.B The Burning Bush
- A simple UNIX command interpreter.
Expand Down
4 changes: 2 additions & 2 deletions src/arrays.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file arrays.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for functions to manipulate arrays.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/directories.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file directories.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for directory-related functions.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file environment.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for manipulating shell environment.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/execution.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file execution.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for functions that handle execution of commands.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file fileops.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for file operations
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/get_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file get_info.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for functions to extract information.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/globs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file globs.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for glob operations.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file help.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for help-related functions.
* @version 2.1
* @date 2023-02-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/help_msgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file help_msgs.c
* @author Ian Duncan (dr8co@duck.com)
* @brief file for help messages.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file history.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for manipulation of shell history.
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file main.c
* @author Ian Duncan (dr8co@duck.com)
* @brief entry point to the shell
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down Expand Up @@ -60,7 +60,7 @@ int main(__attribute__((unused)) int argc, char **argv) {
exit(EXIT_FAILURE);
}
// Print help if the shell was called with 'help' argument on the command line.
if (argv[1]) {
if (argc > 1) {
if (str_cmp(argv[1], "help") == 0)
find_help(NULL);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file main.h
* @author Ian Duncan (dr8co@duck.com)
* @brief project header file
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file memory.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for memory management and related functions
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/numbers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file numbers.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for numerical computations
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/process_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file process_cmd.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for functions to process commands
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file prompt.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for printing shell prompts
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/signal_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file signal_handler.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for input handling
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/strings_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file strings_1.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for string operations
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions src/strings_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file strings_2.c
* @author Ian Duncan (dr8co@duck.com)
* @brief source file for string operations
* @version 2.1
* @date 2023-01-21
* @version 3.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023
*
Expand Down
Loading

0 comments on commit ad9f188

Please sign in to comment.