Giter Club home page Giter Club logo

kfsh's Introduction

kfsh

a minimalist bash-like shell

Overview

Using the availible GNU C library on linux systems, I made a minimal shell that performs some mundane commands that users execute.

How to use

You can run and try the shell by following these steps:

  • create the shell executable by running make shell
  • execute the executable by running ./shell

Or you can use the shell api in your code:

  • include the kfsh.h header file in your code
  • add the targets kfsh.c source/gdir.c source/genv.c source/prt.c source/mkf.c source/rmf.c source/ldir.c source/sdir.c source/cdir.c source/pfl.c source/mfl.c source/rfl.c source/finf.c to your gcc command while compiling to a binary

Commands

These are the currently supported commands:

Note: directory and file paths can be either relative or absolute
Command options option arguments arguments format use
cdir none none directory path cdir dir/ change working directory
ldir -s none directory path ldir dir/ [-s] list directory
gdir -s none none gdir [-s] get current working directory
sdir none none directory path and file name sdir dir/ /file.ext search for file in directory
mkf -u -g -o permissions(rwx) directory name mkf -u perm -g perm -o perm dir/ create directory
rmf none none directory path rmf dir/ delete empty directory
finf none none file path finf /file.ext print file info
mfl none none file path mfl /file.ext create file
pfl none none file path pfl /file.ext print file
rfl none none old path and new path rfl /old.ext /new.ext rename or move file
prt -n -r -s print sting none prt -[nrs] string print string
genv --uname --home --shell --editor --lang --path none none genv [--name] [--home] [--shell] [--editor] [--lang] [--path] get environment variable

Resources

Tutorials are really scarce for developing a shell from scratch, however documentation is not ! Here are some resources that streamlined my development process:

More to come

Features I will be implementing soon:

  • Sudo priveledge modifier
  • command history
  • redirecting output
  • pipes
  • process related commands
  • setting related commands
  • git command

kfsh's People

Contributors

dxmxnlord avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.