Skip to content

A shell similar to bash which includes a remote connection part and my implementation for more, diff, chmod, etc. Supports piping and redirection.

Notifications You must be signed in to change notification settings

mihai-bontea/Custom-Shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Shell

Features

  • bash-like prompt showing the user and current directory. (built with the help of the environmental values of LOGNAME, SESSION_MANAGER and HOME)

  • Always starts in home/user, despite the actual location of the project.

  • Supports the commands that the normal shell supports, and extra commands given as executables in the directory holding the project.

  • Supports piping and redirection.

  • Has command history

1

2

Networking Part

  • The server is multithreaded and accepts multiple connections at the same time

3

Compilation Instructions

sudo apt-get install libreadline6-dev
gcc -c -o UtilIO UtilIO.c
gcc -g -o main main.c -lreadline
gcc -g -o chmod chmod.c
gcc -g -o diff diff.c
gcc -g -o server server.c -pthread
gcc -g -o client client.c

Known Bugs

One bug is caused by the readline function, specifically that this command cannot recognise that it's not starting at column 1 of the line, and as a consequence, for long enough commands it will start overwriting its own prompt. This goes unnoticed when not using many pipes.

So when testing long chains of commands linked by pipes, an easy fix is to add a newline character after the prompt.

About

A shell similar to bash which includes a remote connection part and my implementation for more, diff, chmod, etc. Supports piping and redirection.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages