GithubHelp home page GithubHelp logo

iarchiveml / posixsh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from toorajtaraz/pandash

7.0 0.0 1.0 41 KB

Simple shell environment written in C, using posix_spawn to run executables.

C 97.46% Makefile 2.54%

posixsh's Introduction

posixsh

posixsh is a simple shell written in c using posix_spawn to run executables. It can handle most basic tasks that any other interactive shell can handle.

Installation

Just make sure you have gcc and make installed, then simply run:

make all

Usage

After runing just type "help".

WELCOME TO PANDASH, A SIMPLE SHELL WRITTEN IN C
BUILT IN COMMANDS:
	help:
		IT WILL PRINT THIS PROMT
	cd [path?]:
		IT WILL CHANGE CWD TO 'PATH' OR $HOME
	exit:
		IT WILL TERMINATE THE CURRENT SHELL
	pandash_talk [YOUR_ID] [THE_OTHER_SHELL_ID]: (ID can be anything)
		GOES TO CHAT MODE AND YOU CAN CHAT WITH ONE OTHER PANDASH SHELL
	pandash_send [THE_OTHER_SHELL_ID] [YOUR QOUTED MSG]: (ID can be anything)
		TRYS TO DELIEVER YOUR MSG, YOUR ID IS PRINTED AS SOON AS YOU EXECUTE THIS PROGRAM

About

If you are willing to run a script - like the example i have provided - you can run "pandash scriptName" and for interactive mode just run "pandash". It is always listening for other pandas messages.

You can also communicate with other pandash shells using "pandash_talk" built-in command, it will take you to chat mode and you can start sending messages, just make sure your provided IDs are not identical. For example if your id is COOL and the other shell's ID is COOLER your should run "pandash_talk COOL COOLER" and the other shell must run "pandash_talk COOLER COOL" (you choose your ID by typing this command)!

More details

Each command you type to execute is handled by a child process and can be terminated using Cntrl+c. Piped commands are handled in the same manner but they exchange their stdin and stdout.

Named pipes, aka FIFO, is used for implementing communication functionality and a child process is responsible for handling "chat mode" so you can use Cntrl+c to exit from "chat mode".

Hope you enjoy! Use at your own risk :)

posixsh's People

Contributors

toorajtaraz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

speamtalk

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.