Open ak0327 opened 1 year ago
<, <<, >, >>が混在したケースの実験により、おおよその実行順&優先度を把握。 混在するケースでも整形すればシンプルな形で実行できそう。 明日(Jan/8th)、実装に取り掛かり、明日中に目処を立てたい。
minishell $> echo hello<< >><><><><><hoge><>foo><<><<><>><test<<out
splitted_cmds:{"echo", "hello", "<<", ">>", "<", ">", "<", ">", "<", ">", "<", ">", "<", "hoge", ">", "<", ">", "foo", ">", "<<", ">", "<<", ">", "<", ">>", "<", "test", "<<", "out"}
minishell $> echo hello< ><><>>><<<><<<><><><><hello>>>><<<<><out> hoge> <<<file <>in<>>><<out<>foo<>
splitted_cmds:{"echo", "hello", "<", ">", "<", ">", "<", ">>>", "<<<", ">", "<<<", ">", "<", ">", "<", ">", "<", ">", "<", "hello", ">>>>", "<<<<", ">", "<", "out", ">", "hoge", ">", "<<<", "file", "<", ">", "in", "<", ">>>", "<<", "out", "<", ">", "foo", "<", ">"}
Redirectionの処理の流れのうち、以下[3]まで完了
明日(Jan/9th)で一区切りつきそう。
一通り完了したらmainへmergeする予定
[4] 完了
minishell $> echo hello world | cat Makefile > out << limiter > out | cat -e <in >>out
#DEBUG[print_stack : check tree]
[root]
|
[pipe]
|
[cmd]--{"echo", "hello", "world"}
[cmd]--{"cat", "Makefile"}
[cmd]--{"cat", "-e"}
実行時にredirect in, outができるよう、関数の実装等を進める here_docはそれが終わり次第
redirect in/out, here_docの実行順を修正
残課題
TODO
bash-3.2$ cat << end
> aa
> bb
> cc <-press ^D
> aa
bb
cc
implement redirection part