Skip to content

Neel2k5/berryshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BERRYSHELL

Overview

The shell provides a handful of basic commands like pwd,lst(similar to ls),cp(similar to the original cp), and more while also allowing customisation of the promptname and prompt coloursthrough a configuration file. This is more of a personal project for learning than a full scaled software so there are still many things it lacks.

Features

-Custom command set: Includes a few basic commands mostly for files and directory management.

-Customisation: The shell's prompt is built up of three colours along with a custom prompt name that can be customised from the bs.config file

-Command History logging: The shell maintains a log.txt file that is used to keep a history of commands entered in the shell and is acessed by the command hst

Setup

Prerequisites

  • C compiler (if you wish to compile/edit src files or the shell from scratch)
  • UNIX type operating system

Project Directory Structure:

berryshell
|
|bs_example.sh <-- startup script 
|('*' -> acessed by startup or main binary)
|
|config*  <-- configurations
||bs.config(Custom prompt names and colours can be set in this file, reaad by shell's main bin)
|
|bbin*  <-- berrybin
||...(compiled binary files of the shell commands and the actual shell, acesssed by the startup script)
|
|manuals*  <-- Manuals
||...(text file manuals of all available commands, acessed by help command)
|
|logs
||log.txt <- Log file read by hst
|
|docs 
||...(md files including README and LISENCE)
|bsrc  <-- bin source
||...(.c files of the commands and the actual shell)

Step 1: Clone this repository

Run this on your terminal.

git clone https://github.com/Neel2k5/berryshell.git 

Step 2: Navigate to the project directory

cd berryshell

Step3 Edit/Write the startup script bs.sh

Setting the BERRY_PATH env var is essential as it is used by multiple binaries for functioning.

#!/bin/bash

export BERRY_PATH= #Add the path of the project directory
export PATH=$BERRY_PATH/bbin


echo "berryshell"

$BERRY_PATH/bbin/bs_main

Step 4: Execute the startup script.

Update permissions to executable

chmod +x bs.sh

Run it

./bs.sh

Basic Usage

Type help or help * for a list of all the manuals for commands. Type e or exit to exit the shell.

Few commands to get iyou started.

lst (similar to ls) cdir (similar to cd) pwd disp (similar to cat) help

Customisation

The shell reads from config/bs.config for the prompt color and custom prompt name. The config file follows a certain syntax that has been mentioned in the file itself. While running if resetsett command is entered, it temporarily changes the colour and custom prompt name to the default values. updatesett Updates the values from the configuration file.

Contribution

Contributions will open later in the future... Comments are welcomed.

License

This project is listed under the APACHE 2.0 LICENSE

Contact

EMail

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published