jojomo96 / minishell Goto Github PK
View Code? Open in Web Editor NEWThis project is about creating a simple shell.
This project is about creating a simple shell.
and
and or
unset -TEST
➡️ 2
unset TES;T
➡️ 127
export --TEST=123
➡️ 2
issue for all the leak related stuff
exspecially the stuff we can't fix with ft_malloc
getcwd()
mallocsft_init_split_state()
mallocsstrjoin
in ft_process_file
itoa
in handle_shlvl
split
in ft_export_print
ft_handle_split
ft_split_on_delim
ft_env_get
ft_init_wildcard_data
ft_handle_env_variable
encase_outer_quotes
currently only executed leafs get expanded
bash-3.2$ ./srcs/
bash: ./srcs/: is a directory
bash-3.2$ echo $?
126
currently 127
bash export technically supports +=
which joins the previous with the new entry
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
bash-3.2$ somethingwrong
bash: somethingwrong: command not found
$?
last exit code$ENV
the value of the env if given, otherwise empty string*
all files in current dir~
*
like *.c
(only for current working dir)unlike just hitting enter, this should error
bash-3.2$ ""
bash: : command not found
bash-3.2$ echo $?
127
add check to see if there is actually a tree, otherwise just read again
👋 minishell ➜
zsh: segmentation fault ./minishell
ctrl+C
displays a new prompt on a new line.ctrl+D
exits the shellalways reset everything before and after heredoc
ctrl+C
leaves heredocctrl+D
does nothing if something typed, leaves if current line emptyctrl+\
does nothing👋 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
>> '$USER'
create file even if left side is empty
input:
echo test1 test2
expected:
test1 test2
(ein space)
currently:
test1 test2
(zwei tabs)
/ls
should be treated as direct path, and therefore not work
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
bash-3.2$ cat | cat | ls
Makefile b b c d ho baum includes libft minishell obj srcs subject.pdf test
bash-3.2$
echo hi | cat < Makefile
should print Makefile contents not "hi". in this case the redirect should have priority over the pipe
this is supposed to work. the value is 4=2
export NEW=4=2
env | grep 4=2
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
ls|cat Makefile|<wc -l
returns 0 instead of 1
minishell: cd: cd: No such file or directory
redirect in is stuck afterwards and enter segfaults the shell
add a wrapper for execve
if export happens without value (but =
) there should be an =
in the env.
export USER=
env | grep USER
currently only adds USER
not USER=
/bin/echo 42 > /dev/null > /dev/null > /dev/null > /dev/null > tmp_redir_out
should result with 42
in the tmp_redir_out file. currently it gets created but is empty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.