Giter Club home page Giter Club logo

seachell's Introduction

SeaChell

C Shell

#THINGS TO WORK ON

  • (DONE - NEEDS TESTING) * make non space special chars work (a|b>d)
  • (DONE - NEEDS TESTING) * &
  • (DONE) * implement config file
  • (DONE - NEEDS TESTING) * do combinations work like a real shell (cmd < a > b | c > d <....)
  • (DONE - NEEDS TESTING) * make multiple redirects work (i.e. cmd < filein > fileout 2> fileerr)
  • (PROBABLY IMPOSSIBLE) * Tab completion
  • (PROBABLY IMPOSSIBLE) * up and down for recent commands run
  • (DONE) * |
  • (DONE) * >
  • (DONE) * <
  • (DONE) * >>
  • (DONE) * cd
  • (DONE) * exit
  • (DONE) * replace home dir with ~
  • (DONE) * figure out tab situation

#IMPLEMENTS

  • |
  • <
  • cd to home cd home
  • cd to path directories
  • exit
  • config file
  • &
  • make non space special chars work (a|b>d)
  • make multiple redirects work (i.e. cmd < filein > fileout 2> fileerr)
  • do combinations work like a real shell (cmd < a > b | c > d <....)

#BUGS

  • permission errors: Not having write permissions and trying to write out will segfault, attempts to fix this using eaccess/access block permissions to multiple writable places

#FILE AND FUNCTION HEADERS

chell.c: handles everything

	/*======== static void cp_pipe() =========================================================
	Inputs: none
	Returns: nothing

	Description: forks for chell to run
	========================================================================================*/

	/*======== static void sig_childactive(int sig) ==========================================
	Inputs: int sig
	Returns: none

	Description: signal handler for SIGINT when a child is active
	========================================================================================*/
	
	/*======== static void sig_nochild(int sig) ==============================================
	Inputs: int sig
	Returns: none

	Description: signal handler for SIGINT and SIGTERM when the child is not active
	========================================================================================*/
	
	/*======== void exit_custom() ============================================================
	Inputs: none
	Returns: none

	Description:  exits chell
	========================================================================================*/
	
	/*======== void prompt() =================================================================
	Inputs: none
	Returns: none

	Description: displays chell prompt with user info and current path 
	========================================================================================*/

	/*======== void chell(char *words) =======================================================
	Inputs: char *words
	Returns: none

	Description: wrapper function for chellFd
	========================================================================================*/
	
	/*======== void chellFd(char *cmd, int infd, int outfd, int errfd) =======================
	Inputs: char *cmd, int infd, int outfd, int errfd
	Returns: none

	Description: takes cmd and input, output, and errror and parses the cmd and sends
	to  command(char **words, int infd, int outfd, int errfd, int shouldiwait)
	========================================================================================*/

	/*======== int command(char **words, int infd, int outfd, int errfd, int shouldiwait) ====
	Inputs: char *words
	Returns: none

	Description: runs words array of command with proper input, output, and error
	handeling
	========================================================================================*/
	
	/*======== void execline(char *line, char *cmd) ==========================================
	Inputs: char *line, char *cmd
	Returns: none

	Description: parses input by semicolons and runs the individual commands
	========================================================================================*/
	
	/*======== char *readall(char *path) =====================================================
	Inputs: char *path
	Returns: none

	Description: reads file
	========================================================================================*/
	
	/*======== char **splitread(char **full) =================================================
	Inputs: char **full
	Returns: none

	Description: splits full into lines
	========================================================================================*/
	
	/*======== char* linerepls(char *line) ===================================================
	Inputs: char *line
	Returns: none

	Description: replaces certain things in a line
	 current replacements:
       ~: getenv("HOME")
       > >> < 2> 2>> &> &>> |: add spaces around em
	========================================================================================*/
	
	/*======== int main() ====================================================================
	Inputs: char none
	Returns: none

	Description: main function that is run when the executable file is run
	========================================================================================*/



#Authors Shantanu Jha Gabriel Marks Charles Zhang

seachell's People

Contributors

charles-ah avatar marksg07 avatar phionx avatar

Watchers

 avatar  avatar  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.