iijung / minishell

간단한 bash 쉘 구현
0 stars 1 forks source link

Enhance/no builtin#87 #88

Closed CodyKat closed 1 year ago

CodyKat commented 1 year ago

fix: edit no_builtin command logic

as-is

./ls 실행시 /bin/ls가 실행됨

be-to

  1. check path_cmd or general_cmd

(path_cmd)

2-1 : check file is there

2-2(found file) : execve!

2-3(file not found || execve fail) : print error && exit correct exit_status

(general_cmd)

2-1 : loop path and check file is there.

2-2(find file) : execve! if execve failed exit 0

2-3-1(found file) : try execve, if failed exit 255

2-3-2(file not found) : print error && exit 126 || exit 127