๐Ÿ“Œ Overview

42Seoul C ๊ธฐ๋ฐ˜ ๊ฐ„๋‹จํ•œ shell ๊ตฌํ˜„

ํ•ญ๋ชฉ ๋‚ด์šฉ
๊ธฐ๊ฐ„ 2024.05 ~ 2024.06
์Šคํƒ C Makefile readline fork() execve() pipe() dup2()
ํŒ€ 2์ธ
๋‹ด๋‹น Cmd / Pipe Redirection


๐Ÿงฉ Core features



๐Ÿ—๏ธ System Architecture

architecture


Layer Responsibility
Input readline prompt, history ๊ด€๋ฆฌ
Parser quote, dollar expansion, pipe, redirection, heredoc ์ฒ˜๋ฆฌ
Node command, path, input fd, output fd, previous error number ์ €์žฅ
Exec builtin dispatch, fork, pipe, dup2, wait, execve ์ฒ˜๋ฆฌ
Env environment linked list ์ƒ์„ฑ, ์ถ”๊ฐ€, ์‚ญ์ œ, ๋ฐฐ์—ด ๋ณ€ํ™˜
Signal prompt, child, heredoc signal handler ๊ด€๋ฆฌ


๐Ÿšจ Key Decisions & Troubleshooting

command node ๊ธฐ๋ฐ˜ ์‹คํ–‰ ๊ตฌ์กฐ


pipe ์—ฐ์† ์ƒ์„ฑ ์‹œ fd ๋ˆ„์ˆ˜ ๋ฌธ์ œ ํ•ด๊ฒฐ


builtin๊ณผ ์™ธ๋ถ€ ๋ช…๋ น ์‹คํ–‰ ๋ถ„๋ฆฌ