C program called in a bash loop incrementally reading from a single file never exiting
int main() { char buf[2]; read((0, buf, 2); lseek(0, 1, SEEK_CUR); write(1, buf, 2); } The rwl program, whose source code is shown on the top, is run with the following command on a 2-line fileA text file with “01234” data on each line. Determine the data that this command will display and the changes […]
Execute “env” with execve() in C
Why when I run this code with any other commands (like “date” “pwd” or “ls”) in gives output on screen, but with env not? Path is correct, what exactly is the issue? It is a part of Minishell project which consists in replicating part of the functionality of bash shell.