minishell's Issues
incorrect exit status when piping
setting envars that use quotes does not work
- probably need to split excluding inside quotes
need to trim whitespace from token commands
segfault in execvp if path to dir passed?
expansion on non-existent variables does not work
current behaviour: prints as literal
echo $non_existent
$non_existent
- expected: prints empty
echo $non_existent
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
echo does not work with same args as bash
[echo -n]
- echo -nnnnnnnnn should work
- echo -n -n -n should work as well
custom shell prompt
- implement colour depending on success/fail (exit codes) -> is this actually required?
- show user name in shell prompt
RFC: execution requirements
- global variable signals & signals childs
- redir handling & attributes in tokens
- exit status of last command
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)
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
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
refactoring in parser
- expand_variables function needs to be refactored (again), this time without causing leaks
- #16
- implement do_quotes
cleanup stuff
- token creation
- expansion
- splitting
- some almost empty files
- some super full files
- some commented out files
- look at directory structure/naming
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)
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
fix echo printing with optional argument
echo -nnnnnnhello #does not print
integration testing
should be possible, refer branch
implement return values for builtins
- correct return values for builtins
rename-cleanup-echo
- rename variables (envp, some others)
- fix echo bug
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
- Alternative directory names in CDPATH are separated by a colon (:).
- A null directory name in CDPATH is cwd/''.''
- 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.
lexer backlog
-
we do not care about
()
{}
&&
, they will be treated as literals -
fix unterminated/trailing quotes being allowed through lexer
(input likecd '/workspaces/current project/
quits) -
empty input
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)
lexer can not correctly check pipes
- pipes do not get filtered correctly
- allowed pipes cannot pass through
Details
currently disabled checks for pipes
launching no environment
- USER
- PWD
- supplementary PATH
parsing: handle redirections
- parse redirections to facilitate reading them in execution
- schema of operator (
<, >, >>, <<
), followed by (whitespace,) filename/delimiter
implement export with no arguments
should behave like bash:
for variable true=false
$ export
declare -x true=false
$
- implement printing with "declare -x " prefix
@codergirl-al tbd: implement passthrough from execution (only for last command that was executed)
split command array correctly
- fix spaces inside quotes being split as outlined in #8
- split pipes correctly
fix export/unset
- incorrect error messages/errors where there are none
- incorrect error exit codes
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)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.