Uh oh!
There was an error while loading. Please reload this page.
feat: add redirection operator - #76
Conversation
daniel-rossier
left a comment
There was a problem hiding this comment.
Please review the coding conventions and adapt accordingly
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * GNU General Public License for more details.printf("Ciao\n"); |
| pipe_on = 1; | ||
| argv[arg_pos] = NULL; | ||
| } else { | ||
| }else if(!strcmp(tokens[arg_pos], ">")){ |
There was a problem hiding this comment.
Follow the coding convention: spaces between keywords
| */ | ||
| void process_cmd(void) { | ||
| int i, pid_child, background, arg_pos, arg_pos2; | ||
| int i, pid_child, background, arg_pos, arg_pos2, redirection, byte_readen; |
There was a problem hiding this comment.
byte_read ;-) (not readen)
| char *argv[ARGS_MAX], *argv2[ARGS_MAX]; | ||
| char filename[30]; | ||
| int pid, sig, pid_child2; | ||
| int pid, sig, pid_child2,fd; |
There was a problem hiding this comment.
I was thinking about adding a .clang-format file to easily format files and possibly enable auto-formatting during commits. Is this a good idea ?
There was a problem hiding this comment.
Yes, this is a very good idea. Thank you! Would you add it along this PR or in another PR?
There was a problem hiding this comment.
I will add it in another PR !
There was a problem hiding this comment.
Perfect, so please make the last cleanup changes.
This pull request adds support for the redirection operator in the shell of SO3. I followed a similar approach to the implementation of the pipe operator to ensure consistency in the code. This allows for input and output redirection within the shell.
I would appreciate any feedback or suggestions. Thank you for reviewing!