Coder Social home page Coder Social logo

iso53 / custom-linux-shell-with-multiprocess-management Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 57 KB

MyShell is a meticulously crafted Linux shell program, implemented in C, tailored to operate seamlessly as a terminal application within your system. It encompasses a repertoire of custom commands, tailored responses, and error messaging functionalities.

C 98.46% Makefile 1.54%
bash c command-line linux shell terminal makefile

custom-linux-shell-with-multiprocess-management's Introduction

MyShell

MyShell is a Linux shell program that i have written in C, designed to function as a terminal program on your system. MyShell includes custom commands, responses, and error messages.

Installation

To install MyShell, follow these steps:

  • Clone the MyShell repository to your local machine.
  • Open a terminal window and navigate to the MyShell directory.
  • Compile MyShell by running the command make.
  • Then type ./myshell

Usage

MyShell is designed to function like a standard Linux shell program, with a few custom commands added. Here are the custom commands included in MyShell:

  • exit: Exits the MyShell program.
  • bash: Calls the default bash shell and allows you to execute bash commands. Returns to MyShell when you type exit.
  • execx: Runs the specified program a given number of times in the background, waiting for each process to finish before continuing. Additional parameters are passed to the program.
  • writef: Writes the system time, process ID, and parent process ID to a file. If the file does not exist, it will be created. If the file exists, the data will be appended to the end of the file.
  • cat message: Returns the message.
  • clear: Clears the terminal screen.
  • ls: Lists all files in the current directory.

Project Functions

Let's start with execx. execx command allows you to call a program any number of times. In this case its writef. Here is how you can do it:

execx -t [number] [program_name] [program_parameters]
writef -f [file_name]

these are the sytnaxes for execx and writef programs. Here how you can use these. Example:

execx -t 3 writef -f foo

this command will write the system time, pid and ppid value in a single line into the file named foo three times. You can also call execx program in execx program. Example:

execx -t 3 execx -t 5 writef -f foo

First execx command will call execx -t 5 writef -f foo three times and than second execx command will call writef -f foo 5 times. You can call as many nested commands as you want as long as you do not exceed the maximum number of arguments (100). You can change this value from the myshell.c file.

Error Handling

MyShell will return an error message if you enter an invalid command or if there is an error with a called program. You can always type help to get help.

First Time?

If you are confused while using the program, you can run the help command like this

help

or like this

help command_name

custom-linux-shell-with-multiprocess-management's People

Contributors

iso53 avatar

Stargazers

 avatar

Watchers

 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.