GithubHelp home page GithubHelp logo

minishell's Introduction

minishell

minishell's People

Contributors

jonstep101010 avatar codergirl-al avatar

Watchers

 avatar

Forkers

alphacharge

minishell's Issues

expansion

  • echo "'$USER'" should expand to 'username' (currently '$USER')
  • echo $KEYsomething should result in empty string
  • echo $$KEY should result in $val (beginning and end)
  • echo "'$KEYsomething'" should result in empty inside single quotes ''
  • echo "'"'$USER'"'" -> '$USER'
  • echo $"42$" -> $42$
  • echo "$ " -> $
  • expansion also has to happen in case of the export command, might require additional modifications: export TES$?T=123 should work with the last exit status (expansion required in this case - find out if it has to be limited in scope)

fix export/unset

  • incorrect error messages/errors where there are none
  • incorrect error exit codes

cleanup in export/unset

  • WIP in export to make it more straightforward
  • consolidate environment related functions into their directory
  • facilitate testing
  • cleanup test support files and dependency trees for individual test files environment
  • fix unset not checking for key===== (skip & do not unset key)
  • rename functions/files

parsing: handle redirections

  • parse redirections to facilitate reading them in execution
  • schema of operator (<, >, >>, <<), followed by (whitespace,) filename/delimiter

builtin_exit

  • stricter numbers checking
Details

from tester:

exit 9223372036854775807

exit something somethingv2

exit 0 0

exit

exit ""

exit "+100"

exit "-100"

exit -9223372036854775805

exit 0

exit 10

exit 42

exit 1

exit +++++

exit ++++++

exit +1

exit ++1

exit ++12560

exit -----

exit ------

exit -1

exit --1

exit -12560

exit --12560

exit 255

exit 1 2

exit 1 2 3

exit A

exit A 2 3

exit "A"

exit "+++"

exit ++++3193912939

exit 01

exit 001

exit 0001

exit +++000

exit ++++000

exit ---000

exit ----000

exit "something"

exit x

exit echo

exit cd ..

exit exit

exit 42 42 42 42 42

  • implement correct exit codes like bash for specific input to exit command (wontfix)

builtin_cd

Change the current directory to dir using chdir & getcwd

  • update environment pwd
  • $HOME is the default dir
  • $CDPATH defines the search path for the directory containing dir
  1. Alternative directory names in CDPATH are separated by a colon (:).
  2. A null directory name in CDPATH is cwd/''.''
  3. If dir begins with a slash (/), then CDPATH is not used

If a non-empty directory name from CDPATH is used and the directory change is successful, the absolute pathname of the new working directory is written to the standard output.

The return value is true if the directory was successfully changed; false otherwise.

pipes

  • implement pipes to allow for execution of multiple commands
  • prototype as early as possible
  • implement heredocs
  • implement redir (in, out, append)
  • implement path finding for binary

custom shell prompt

  • implement colour depending on success/fail (exit codes) -> is this actually required?
  • show user name in shell prompt

builtins bugs: collection

  • small issue in echo with optional argument
  • #51 (strict checking not planned atm)
  • unset: printing on error (start with $...)
  • fix expanded builtin var hello=echo, $hello should launch builtin (set_cmd_func again)

lexer can not correctly check pipes

  • pipes do not get filtered correctly
  • allowed pipes cannot pass through
Details

currently disabled checks for pipes

- [ ] make lexer work with all kinds of allowed pipes/refactor parser to handle?

cleanup stuff

  • token creation
  • expansion
  • splitting
  • some almost empty files
  • some super full files
  • some commented out files
  • look at directory structure/naming

refactoring in parser

  • expand_variables function needs to be refactored (again), this time without causing leaks
  • #16
  • implement do_quotes

lexer-redirs-pipes: incorrect input

  • where does incorrect input cause return?
  • error checking for trailing redirections
  • print on error
  • do most checking in lexer
  • cat <"./test_files/infile" | echo hi

export bugs

  • export = export ''='' export ""="" should fail: export: `=': not a valid identifier
  • export echo nothing should be printed
  • export NEW="4=2", export NEW=4=2 -> should be successful
  • export TES\\~T=123 -> export: `TES~T=123': not a valid identifier
  • add test for expansion inside name, e.g. export $? (fail case), export TES$?T=123 (depends on last exit status, success)
    -> success depends on #41 (done before)
  • make sure varname does not start with numbers (everything other than _, alphabetic)

cleanup_builtins_refactor

  • add dprintf as dependency
  • cleanup code for builtins
  • split up libft, gnl, printf, custom functions into libraries
  • refactor big functions in builtins

lexer backlog

  • we do not care about () {} &&, they will be treated as literals

  • fix unterminated/trailing quotes being allowed through lexer
    (input like cd '/workspaces/current project/ quits)

  • empty input

RFC: execution requirements

  • global variable signals & signals childs
  • redir handling & attributes in tokens
  • exit status of last command

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.