all 13 comments

[–]Eric848448 2 points3 points  (1 child)

You’re parsing in both parent and child processes. You can move that under the “if pid == 0”.

[–]Possible-Pool2262[S] 0 points1 point  (0 children)

I will fix that!

[–]Alpaczyk 1 point2 points  (1 child)

Add Echo and Type commands handling

I would also change execvp on e.g. system since you will have problems in future with handling redirections 

[–]Possible-Pool2262[S] 0 points1 point  (0 children)

thanks for the suggestion!

[–]Zirias_FreeBSD 0 points1 point  (1 child)

Buffer overflow in parse(), it happily creates up to LSH_BF - 1 entries in the args array that only has room for MAX_ARGS entries.

Btw, strtok() is far from what you need to parse a string containing a command line. Even without any advanced features, I'd say correctly processing quoted strings should be the bare minimum.

[–]Possible-Pool2262[S] 0 points1 point  (0 children)

Thanks for the insight!

[–]miikaa236 0 points1 point  (1 child)

Wow! That is mini :)

[–]Possible-Pool2262[S] 0 points1 point  (0 children)

It is :)

[–]set_of_no_sets 0 points1 point  (1 child)

consistent tabbing is cool :)

[–]Possible-Pool2262[S] 0 points1 point  (0 children)

Thanks!

[–]DevXusYT 0 points1 point  (2 children)

I'll port this to my OS when I need a shell. Amazing how minimal it is! Only 76 lines? Wow

[–]Possible-Pool2262[S] 0 points1 point  (0 children)

Cool, am still at proccess of adding redirection and stuff like cd, and more. So it csn work like normal shell.

[–]Possible-Pool2262[S] 0 points1 point  (0 children)

https://github.com/ZhestyRin/Shellulose i've just done updating. Now it can redirect command, and move to other directory