Giter VIP home page Giter VIP logo

simple-shell's Introduction

Simple Shell

A simple shell written in C. Multiple commands may be separated by ';' or '|', but input and output redirection are not implemented. Basic functionality such as "cd" and "pwd" are provided. Any other valid input will be launched using the fork() system call. Uses the GNU readline library for user input.

Sample output

[dan@server simpleshell]$ ./simpleshell
> pwd
/home/dan/simpleshell
> ;ls -l |       whoami ;;
Pipe not implemented
total 32
-rw-r--r-- 1 dan dan   114 Feb 21 04:55 Makefile
-rw-r--r-- 1 dan dan  3802 Feb 21 15:27 simpleshell.c
-rwxr-xr-x 1 dan dan 13648 Feb 21 15:28 simpleshell
-rw-r--r-- 1 dan dan  3434 Feb 21 15:27 tokenizer.c
-rw-r--r-- 1 dan dan   755 Feb 21 15:27 tokenizer.h
Process exited successfully
dan
Process exited successfully
> ls; cat Makefile > out.txt; whoami;
Makefile  simpleshell.c  simpleshell  tokenizer.c  tokenizer.h
Process exited successfully
IO redirection and background not implemented
CC = gcc
CFLAGS = -std=c99 -lreadline

simpleshell: simpleshell.c tokenizer.c
        $(CC) $(CFLAGS) -o simpleshell simpleshell.c tokenizer.c
Process exited successfully
dan
Process exited successfully
> cd doesnt_exist
Directory does not exist or is not accessible.
> cd too many args
Accepts exactly one argument
> cd ..| cd ..
Pipe not implemented
> pwd
/home
> doesnt exist 1 2 3
Unable to execute doesnt
> whoami red
whoami: extra operand 'red'
Try 'whoami --help' for more information.
Process exited with error
> echo hello world &
IO redirection and background not implemented
hello world
Process exited successfully
>

simple-shell's People

Contributors

deobfuscate avatar

Stargazers

 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.