Giter Site home page Giter Site logo

minishell's Introduction

minishell

A simple shell.

ms

This program was developed by Yuta-Fujimoto and AuroraSloan

Features

Simple commands

  • Search and launch any executable in $PATH

Builtin commands

Command Options / Arguments
echo -n
cd relitvie or absolute path
pwd n/a
export no options
unset no options
env n/a
exit no options

Expansion

  • ' inhibits all interpretions of a sequence of characters
  • " inhibits all interpretation of a sequence of characters except for $
  • Environment values expand to their values
  • $? expands to the most recently executed foreground pipeline

Redirection

  • < redirects input
  • > redirects output
  • << reads input from the current source until a linie containing only the delimiter is seen
  • >> redirects output with append mode

Piping

  • The output of each command in the pipeline is connected via a pipe to the input of the next command

Signals

  • Ctrl-c prints a new prompt on a new line
  • Ctrl-d exits the shell
  • Ctrl-\ does nothing

Installation

git clone https://github.com/AuroraSloan/minishell.git

Usage

First, create the executable with make
make - compiles the minishell executable
make clean - removes all object files
make fclean - removes all object files and the executable
make re - removes all object files and the executable before recompiling the program

In order to run the program, simply run the executable.

./minishell

To exit the program, you can use the builtin command exit or press Ctrl-d.

minishell's People

Contributors

aurorasloan avatar yuta-fujimoto avatar

Watchers

 avatar

Forkers

yuta-fujimoto

minishell's Issues

cat | cat | ls

waitpid is called by newline or ;
it may not be called by the end of each execution (execve or builtin)

environ memory leak

add free_environ when the end of minishell

we may should use valgrind to check memory leak!!!(test.sh shou;d be rewrited)

unset path

unset pathしたあと、何かコマンドを焼ければerrorを出てminishellから出ます

minishell > unset PATH
minishell > ls
minishell:error

今修正してみます

env + argument

bash は no such file or directoryを書いているけど mshは 無視してenvを表現します

echo "echo hello" > a; chmod 300 a ; a

minishell だと
minishell > ./a
でなにもしない
bash-3.2$ ./a
bash: ./a: Permission denied
これはまだどうしたらいいかわかりません

644は同じ

malloc error handling in lexer and parser

lexarはほとんど大丈夫ですけどmalloc errorがあれば、readlineのinputをfreeしないexitをしていると思います。
parserはいろいろな変更しなければならないと思います

export aaaaaaa; export

declare -x TMPDIR="/var/folders/zz/zyxvpxvq6csfxvn_n0000rx4000679/T/"
declare -x USER="fyuta"
declare -x aaaaa

こんな感じ
envだと出力しない
これはひとつのpull requestでやります

exit - 1 出る書くことが違うエラー

私はあまり気にしないけどゆたさんはそれは大切があるかどうかわからないです
exit -- 1を確認しているときこれを見ました
exit - 1 をかけば
too many argumentsを書いているけど、bash は numeric argument requiredのエラーを書いています

cd symbolic link

bash-3.2$ mkdir dir
bash-3.2$ ln -s dir symdir
bash-3.2$ cd symdir
bash-3.2$ pwd
/Users/fyuta/symdir
bash-3.2$

exit 0 0; ls

if ac >= 3 in exit, it doesn't execute and ls isn't executed, too !!

cat & ctrl -c error

普通にcatを使っていて、ctrl -c をかけば、minishellから出ないけど、「minishell:error」を表現しています

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.