Giter Site home page Giter Site logo

nutsh's Introduction

๐Ÿฅœ nutsh ๐Ÿฅœ

An elementary Unix shell, for educational purposes.

https://github.com/SeanFxyz/nutsh

Written by Sean M Fitzgerald

[email protected]

Prerequisites

You must have a POSIX/Unix-like environment with a C compiler accessible via the cc command, and the POSIX standard libraries.

On Linux, *BSD, and similar systems you likely have these already. If not, look up how to install the basic development tools on your distribution.

On MacOS, you could install the official Apple Developer Tools package, but I would prefer to install Homebrew and then run brew install gcc make from the terminal to install the gcc and make packages.

If you'd like to try this out on Windows, I recommend Cygwin. Be sure to install Cygwin's gcc-core and make packages during setup.

Compiling

You can get the code by downloading a zip file from the GitHub page or by cloning the repository:

$ git clone [email protected]:SeanFxyz/nutsh.git

After acquiring the source code, enter the source code directory and simply run the make command:

$ cd nutsh
$ make

You can also run make debug to compile a version with debug symbols enabled for use with gdb or similar debugging tools.

Installing

You can install nutsh to your system by running make install with root privileges to copy the nutsh binary to /usr/bin/

If you don't have root privileges, you can also copy the binary to ~/.local/bin/, which is likely to be in your path, and can easily be added if it isn't already.

Features

Commands

At present, nutsh will run any program in your $PATH as well as four builtin commands:

  • help: displays builtin commands
  • cd: changes the current directory
  • pwd: prints the current directory
  • exit: terminates the shell

Pipes

Pipes from one program to another are supported, but are not compatible with builtin commands.

To pipe from one program to another, type a command that outputs to stdout, like ls, then a pipe | character with with spaces on either side, then another command that reads from stdin, like grep, all on the same line, like this:

๐Ÿฅœ$ ls Movies/ | grep -i nut
Nutcracker.mp4
The Nut Job.mp4
The Nutty Professor.mp4
๐Ÿฅœ$

You should be able to chain as many commands as you like this way:

๐Ÿฅœ$ ls Movies/ | grep -i nut | cowsay -n
 _________________________
/ Nutcracker.mp4          \
| The Nut Job.mp4         |
\ The Nutty Professor.mp4 /
 -------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
๐Ÿฅœ$

nutsh's People

Contributors

seanfxyz avatar

Stargazers

Rowanda avatar  avatar

Watchers

 avatar

nutsh's Issues

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.