abeaugustijn / minishell Goto Github PK
View Code? Open in Web Editor NEWA simple shell for the 42 curriculum
A simple shell for the 42 curriculum
When calling a env_variable for the second time the application aborts.
For example: echo "test" > file.txt
This should just take stdout (? i guess), and write it to the file.
ctrl-c
, ctrl-d
, ctrl-\
and a bunch of other exit status stuff isn't working properly.
Running with just ;
results in a segmentation fault.
every command execution a ROOT LEAK
occurs.
Try ./Makefile
. Should say Permission denied
The parser should define the relationships between commands. So a command with a trailing |
character should have the relationship-value of PIPE
.
This information can then later be used to handle all redirections and such.
When giving input like test
and then pressing ctrl + D
twice would result in exit when it shouldn't.
run base64 < /dev/urandom | head -c 100
once ready, could result in issue with waitpid.
Like: echo "neofetch" >> ~/.minishellrc
executables don't work, need to look in PWD for executables
Echo ; echo \n ' \n this is the; "first line"' ; echo "and right here;;; 'We have the second'" ; echo and" a fe"'w 'here'; with some slash and quotes .' '\' ; echo '\\' ; echo "\\" ; echo "\"" ; echo \\ ; echo \' ; echo \" "\\" "\"" \\ \' \"
results in a segfault.
'$HOME'
should not expand to environment variable.
Semicolon doesn't work as expected.
echo "test1"; echo "test2"
results in:
test1 echo test2
echo test1; echo test2
results in:
test1
test2
Pipes don't work yet
When a trailing semicolon is left in a command, the shell interprets it as an empty command, so it exits.
e.g. echo test;
Don't work yet
Try exit
for example
Shell will also replace $HOMElslslsl
with the env var, need to change this.
An example of this could be the following.
find / -name "*.c" | grep "test" > all_test_files.txt
The relationships should describe where the output of every command should go.
In this example, the output of the first command should be piped to the second one, which output will be written to the given file.
An idea for a solution could be to add a field to the cmd
struct which defines the relationship to the next command in the list. This relationship could have the value of NONE, PIPE, REDIRECT, APPEND
(or something in that neighborhood.
echo /$"123$USER"
results in /$USER
should be /123$USER
.
$? shows last exit status.
When no command is entered, and return is pressed, the shell exists.
This can be solved by looking at the get_next_line output.
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.