GithubHelp home page GithubHelp logo

axb157030 / shell.c Goto Github PK

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

simple shell in C that can execute executables, pipelined commands, and specific built-in functions like history, changing directories, exiting the shell, executing a past commands.

C 100.00%
shell

shell.c's Introduction

Shell.c

Shell in C that can execute executables, commands, pipelined commands, and specific built-in functions like history, changing directories, exiting the shell, executing a past commands. The built-ins it can follow include: exit: It exits the shell history: It lists up to the first 100 commands that were typed and entered by the user. After the first hundred commands, the shell will replace the oldest command with the newest one. history -c: It clears the commands listed by history. If history is called after this command. "history" will be the only reported command history [offset]: The user can exececute a command that the history built in lists. If the user types hundred commands and in the first command they typed execute the pwd command, and they type the built in history 0. The shell will print the working directory. the offset specfies the index the command is located in the array that stores the history of the users typed commands and executables. cd [directory]: It changes directories like the Linux cd command does. Be aware of the current directory the shell currently is in.

The shell has some built in error detection like when the user types in invalid executables and commands or the shell fails to change to another different directory

Prerequisites

This program can only run on Linux. I ran program in Linux that was installed into a virtual machine.

Running

Type: "gcc mysh.c -o main" to compile the file. Do not include the quotatation marks. "main" in the command could be any name you want but it is the name of the file you will execute. Type "./main without the quotation marks to execute. After this command you can then list the files or Linux commands to execute.

shell.c's People

Contributors

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