Giter Club home page Giter Club logo

chell's Introduction

chell's People

Contributors

karlek avatar nejlika avatar

Watchers

 avatar  avatar  avatar  avatar

chell's Issues

Assignment 'checkEnv'

A built-in command "checkEnv" which should execute printenv | sort | pager if no arguments are given to the command. If arguments are passed to the command then printenv | grep <arguments> | sort | pager should be executed.

The pager executed should be selected primarily based on the value of the users "PAGER" environment variable. If no such variable is set then one should first try to execute "less" and if that fails "more".

Any errors in the execution of the pipeline should be handled in a nice manner (i.e. similar to how your normal shell handles errors in the execution of a manually set up pipeline).

Assignment 'exit'

A built-in command "exit" which terminates all remaining processes started from the shell in an orderly manner before exiting the shell itself.

Assignment 'cd'

A built-in command "cd" which should behave exactly as a normal built-in command "cd" with the exception that you do not need explicitly to update environment variables.

  • cd - is not implemented.
  • cd ~root is not implemented.

bug: polling ignores termination of BG processes if there's a parallel FG process

"... The only issue is that with polling the termination of BG processes is not registered if there's a parallel FG process. "

Error:

$ make; ./chell
(^._.^)ノ @ /home/_/chell $ sleep 1 &
# Wait 1 second on the next prompt, then run any command. 
(^._.^)ノ @ /home/_/chell $ echo

time: 0.001s
(^._.^)ノ @ /home/_/chell $ 

Expected:

$ make; ./chell
(^._.^)ノ @ /home/_/chell $ sleep 1 &
# Wait 1 second on the next prompt, then run any command. 
(^._.^)ノ @ /home/_/chell $ echo

time: 0.001s
[16202] job has ended.
(^._.^)ノ @ /home/_/chell $ 

Feature request: Invoke exit when pressing [ctrl] + [d]

It is common for other shells to invoke exit when the input string is EOF. The key combination [ctrl] + [d] will send an EOF sequence. Not that the shell should not exist if [ctrl] + [d] is pressed after a non-empty input. E.g.

(^._.^)ノ @ /home/u/Desktop/chell $ ^D
### exit ###
(^._.^)ノ @ /home/u/Desktop/chell $ ls ^D
### don't exit ###

Assignment 'detection'

Detection of terminated background process should be implemented by two mechanisms where one selects which should be compiled at compilation time.

The mechanisms are ordinary polling and detection by signals sent from the child processes. The user should be able to select which mechanism to use by defining a macro SIGDET=1 at compilation time to have termination detected by signals. If SIGDET is undefined or equals zero then termination should be detected by polling.

  • Polling
  • Signals

Feature request: quotes

Single- (') and double- (") quotes would be nice. Then we can make git commit -m 'message' inside chell :)

Feature request: Add readline support

This would allow previous commands to be located using the arrow keys. E.g. press "up arrow" to get the last command.

You could also use rlwrap to achieve the same effect.

$ rlwrap chell
(^._.^)ノ @ /home/u/Desktop/chell $ ls
chell  chell.c  README.md
time: 0.003s
### Pressing "up arrow" ###
(^._.^)ノ @ /home/u/Desktop/chell $ ls

Assignment 'foreground / background'

It should handle the execution of processes in foreground and background. For foreground processes the total execution time for the process should be printed when it terminates. For background process information on that they have terminated should be printed no later than when the shell prompts next time after the background process/es have terminated.

  • Foreground
  • Background

bug: Buffer overflow

There exists a buffer overflow in the parse function, which may be triggered when more than 31 args are provided; as demonstrated below.

(^._.^)ノ @ /home/u/Desktop/chell $ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a a a a
chell: Unknown command: A
time: 0.001s
(^._.^)ノ @ /home/u/Desktop/chell $ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a a a a a
chell: Unknown command: A
time: 0.001s
(^._.^)ノ @ /home/u/Desktop/chell $ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a a a a a a
chell: Unknown command: 
time: 0.001s
(^._.^)ノ @ /home/u/Desktop/chell $ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a a a a a a a
chell: Unknown command: �E�z�
time: 0.001s
(^._.^)ノ @ /home/u/Desktop/chell $ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a a a a a a a a
chell: Unknown command: �E�z�
time: 0.001s

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.