- ๐ซ How to reach me [email protected]
toni-schmitt / minishell Goto Github PK
View Code? Open in Web Editor NEWAs beautiful as a shell
As beautiful as a shell
Describe the bug
When pressing CTRL+C while a command is running (like cat) minishell prompt gets printed twice.
To Reproduce
Steps to reproduce the behavior:
cat
or wc
)Expected behavior
minishell prompt should get printed normally without double
Describe the bug
When running cat << eof < file1
minishell trys to open eof thinking its a file.
To Reproduce
Steps to reproduce the behavior:
cat << eof < file1
Expected behavior
eof should not be opened
Screenshots
minishell:
eof
output is from a debug print added here:
minishell/src/brain/utils/expander_utils/handle_redirs_utils.c
Lines 34 to 35 in b27256d
Describe the bug
Commands where a \
is included will get interpreted as syntax error due to
To Reproduce
Steps to reproduce the behavior:
printf hi\n
Describe the bug
when running a command containing a subshell it creates a leak and cuts part of the subshell command
To Reproduce
Steps to reproduce the behavior:
echo hi && (echo this is subshell)
Expected behavior
don't cut the end of the command and don't leak
Additional context
Added the traces of valgrind and tested running without valgrind lead to the same behavior.
Describe the bug
when using som
To Reproduce
Steps to reproduce the behavior:
echo $$
Expected behavior
should just treat it as a string
Additional context
i found that the double free happens in interprete_env_var.c
on line 96 in get_var
Describe the bug
When piping between processes, not more than 64KiB can be sent over the pipe
To Reproduce
Steps to reproduce the behavior:
Execute dd if=/dev/urandom | pv | dd of=/dev/null
The program locks up because write call is blocking, when pressing CTRL+C to send a SIGINT the exit messages of dd and pv show that only 65536 bytes are sent. The problem is also reproducable without pv(pipe viewer) by just executing the 2 dd instances.
Expected behavior
The pipes writing to eachother without it blocking or getting limited to 64KiB
Describe the bug
Wildcard alsways is all stuff from directory
To Reproduce
Steps to reproduce the behavior:
look at what minishell does in screenshot and compare it to what bash does
Expected behavior
look st the screenshot
Additional context
Add any other context about the problem here.
Describe the bug
when running cat Makefile | grep PATH >file1 && cat <file1 && wc file1 && false && echo hi || cat <<eof
the output of the last cat which should print the heredoc is not printed but it should
To Reproduce
Steps to reproduce the behavior:
cat Makefile | grep PATH >file1 && cat <file1 && wc file1 && false && echo hi || cat <<eof
Expected behavior
The output from cat <<eof
is not printed but should be printed, at least my bash prints it
Screenshots
after the red line there should be the output of the heredoc but it isn't
this is the output from my bash, ignore the can't overwrite file
Additional context
Add any other context about the problem here.
maybe rename ft_free_split to ft_free_arr because it is there to free an array of strings.
Describe the bug
When giving input with double quotes text and double quotes text in the middle gets lost
To Reproduce
Steps to reproduce the behavior:
""hi""
Expected behavior
Output should be hi
not empty
Hanlde quotes differently! Quote tokens should be split like this (considering input from above):
""
hi
""
i wrote those new functions in https://github.com/toni-schmitt/minishell/tree/inbuilt/libft
open an issue if sth is not right with these functions
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No error.
Screenshots
Email from 27.10. 09:20pm
Additional context
Add any other context about the problem here.
Describe the bug
all subshells i tested, even valid ones are not working
To Reproduce
Steps to reproduce the behavior:
Expected behavior
run valid subshells
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
$VARS that should be interpreted are not interpreted
when the outside quotes are "
$VARS are interpreted if outside quotes are '
they should just be treated as a string
To Reproduce
Steps to reproduce the behavior:
echo "'$USER'"
Expected behavior
A clear and concise description of what you expected to happen.
Describe the bug
running echo hi && (echo subshell | cat | cat) && echo hi2
never prints hi2
To Reproduce
Steps to reproduce the behavior:
echo hi && (echo subshell | cat | cat) && echo hi2
Expected behavior
print
hi
subshell
hi2
Describe the bug
can't debug this with macOS, when running empty quotes as an argument it prints Permission denied and exits with -1 but not while debugging on macOS.
So debug on Linux!!!
To Reproduce
Steps to reproduce the behavior:
""
or ''
echo $?
Expected behavior
should print command not found
and exit with 127
Additional context
debugging in Linux should give clarity what happens and why
if it doesn't, add a special case if (ft_strlen(cmd)==0) return (cmd_not_found)
Describe the bug
when you run minishell inside minishell and execute a not existing cmd and exit the minishell, then check the exit status with echo $?
it is 0 but should be 127
To Reproduce
Steps to reproduce the behavior:
minishell
haha
exit
or ctrl+D
echo $?
Expected behavior
exit status should be the last exit status, in this case 127
Additional context
only happens if minishell is run inside minishell
Describe the bug
when running echo hi, this is a test | cat | (wc -c && ls -la && false || echo this is true)
it seems to be stuck in a loop and when pressing ctrl+C it prints everything but in a weird way.
To Reproduce
Steps to reproduce the behavior:
echo hi, this is a test | cat | (wc -c && ls -la && false || echo this is true)
ctrl+C
mmiinniisshheell$$
prompt...Expected behavior
should execute every command
output should be like this:
Screenshots
This is how it looks right now:
Additional context
Add any other context about the problem here.
Describe the bug
running echo *
with valgrind shows errors and just segfaults the minishell
To Reproduce
Steps to reproduce the behavior:
valgrind --leak-check=full --track-origins=yes ./minishell
echo *
Expected behavior
print all the folders and files from the current directory.
Additional context
Maybe @toni-schmitt you can find the mistake with the added traces of valgrind.
Describe the bug
minishell thinking ft_strlen(lex_tok)
is a subshell for some reason
while debugging i noticed it goes into the expander
and from there into the subshell function
To Reproduce
Steps to reproduce the behavior:
ft_strlen(lex_tok)
Expected behavior
syntax error
Screenshots
however this happens, it should not get past syntax check
Describe the bug
after executing it exits itself with printing exit
To Reproduce
Steps to reproduce the behavior:
abc | echo hi >file2 | wc
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
Describe the bug
when first running print
and then running print("hi")
minishell aborts with a double free, check traces in screenshot
To Reproduce
Steps to reproduce the behavior:
print
print("hi")
Expected behavior
only printing invalid syntax and then returning to prompt
Additional context
traces from valgrind:
all traces point to sth in lexer and exit_on_syntax_error
Describe the bug
if you run echo test (cat |wc)
it detects a subshell
To Reproduce
Steps to reproduce the behavior:
echo test (cat |wc)
Expected behavior
input error
Screenshots
this is output now (subshell not working right now)
Additional context
problem seems to be in parser
Describe the bug
when running nothing but a subshell it segfaults in is_valid_syntax !is_special line 116 of check syntax
To Reproduce
Steps to reproduce the behavior:
Expected behavior
just run the command
Screenshots
here is the position of the callstack where it is failing
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
echo "-n Hello this is a test if echo is leaking"
Expected behavior
output should look like -n Hello this is a test if echo is leaking
probably there is more errors with ' and " than just this one
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.