GithubHelp home page GithubHelp logo

minishell's People

Contributors

flomero avatar jojomo96 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

flomero

minishell's Issues

leaks

issue for all the leak related stuff
exspecially the stuff we can't fix with ft_malloc

ToDos

External

  • getcwd() mallocs

Internal

  • ft_init_split_state() mallocs
  • strjoin in ft_process_file
  • itoa in handle_shlvl
  • split in ft_export_print
  • itoa in close fds

Strdup

  • in ft_handle_split
  • in ft_split_on_delim
  • in ft_env_get
  • in ft_init_wildcard_data
  • in ft_handle_env_variable
  • encase_outer_quotes

Malloc in GC

  • check for proper malloc protection in gc, where normal malloc has to be used

builtin: export +=

bash export technically supports += which joins the previous with the new entry

ambiguous redirect

if a env expands inside the redirect, it is not allowed to contain spaces. I think ...

bash-3.2$ export test='c d e f'
bash-3.2$ echo a >> test$test
bash: test$test: ambiguous redirect
bash-3.2$ echo a >> $test
bash: $test: ambiguous redirect
bash-3.2$ echo a&& (echo a >> $test )
a
bash: $test: ambiguous redirect

to clear

  • ?
  • *
  • double quotes
  • single quotes

expanding

  • $? last exit code
  • $ENV the value of the env if given, otherwise empty string
  • * all files in current dir
  • ~
  • other wildcards using * like *.c (only for current working dir)
  • should probably remove the outer most quotes after expanding

segfault if input empty

add check to see if there is actually a tree, otherwise just read again

👋 minishell ➜ 
zsh: segmentation fault  ./minishell

signal handling

In the Shell

  • ctrl+C displays a new prompt on a new line.
  • ctrl+D exits the shell
  • #39

In Heredoc

always reset everything before and after heredoc

  • ctrl+C leaves heredoc
  • ctrl+D does nothing if something typed, leaves if current line empty
  • ctrl+\ does nothing

pwd is not printing hole directory

👋 minishell ➜ mkdir "tmp_test_folder"
✅ minishell ➜ /bin/echo $PWD
/Users/jmoritz/Documents/projects/a_minishell
✅ minishell ➜ cd "tmp_test_folder"
✅ minishell ➜ /bin/echo $PWD
tmp_test_folder

pipes: fix order

Current

stuck in first cat, CTRL+C continues with the other stuff

👋 minishell ➜ cat | cat | ls
DEBUG: New node created: Leaf:          arg[0]: cat 
DEBUG: New node created: Node:          |
DEBUG: New node created: Leaf:          arg[0]: cat 
DEBUG: New node created: Node:          |
DEBUG: New node created: Leaf:          arg[0]: ls 
DEBUG: Executing command: cat
DEBUG: /bin/cat

^C
👋 minishell ➜ DEBUG: Executing command: cat
DEBUG: Executing command: ls
DEBUG: /bin/cat
DEBUG: /bin/ls
Makefile    b           b c d       ho baum     includes    libft       minishell   obj         srcs        subject.pdf test

Expected

  1. outputs ls output
  2. enter twice and it leaves
bash-3.2$ cat | cat | ls
Makefile    b           b c d       ho baum     includes    libft       minishell   obj         srcs        subject.pdf test


bash-3.2$ 

builtin: export: print if no arguments

exports prints a list of all exports (even the ones that were not assigned) -> thus there needs to be a second copy of envs for this

bash-3.2$ env
  PWD=/Users/flfische/core/minishell
  SHLVL=1
  _=/usr/bin/env
bash-3.2$ export   
  declare -x OLDPWD
  declare -x PWD="/Users/flfische/core/minishell"
  declare -x SHLVL="1"
bash-3.2$ export test
bash-3.2$ export
  declare -x OLDPWD
  declare -x PWD="/Users/flfische/core/minishell"
  declare -x SHLVL="1"
  declare -x test
bash-3.2$ env
  PWD=/Users/flfische/core/minishell
  SHLVL=1
  _=/usr/bin/env

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.