Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the fork #1

Open
Memli-Sheremeti opened this issue Jan 11, 2024 · 0 comments
Open

Issue with the fork #1

Memli-Sheremeti opened this issue Jan 11, 2024 · 0 comments

Comments

@Memli-Sheremeti
Copy link

Errors in understanding 'fork': the parent process should never execute a command.
Otherwise, a desynchronization issue arises.

When running the test case :

./pipex infile not_a_command1 not_a_command2 outfile.

output : ppiippeexx:: ccoommmmaanndd nnoott ffoouunndd:: llooll

An issue arises in handling commands that are not valid, leading to unexpected behavior in the output.


When running the test case :

./pipex not_a_file cmd1 cmd2 outfile.
output :

BASH :
< not_a_file cmd1 | cmd2 > outfile
output: no such file or directory: not_a_file


When running the test case :

time ./pipex infile "'sleep 3" "sleep 1" outfile
output: /pipex infile "sleep 4" "sleep 2" outfile 0.00s user 0.00s system 0% cpu 2.004 total

BASH:
< infile sleep 4 | sleep 2 > outfile

output: sleep 4 < infile 0.00s user 0.00s system 0% cpu 4.001 total
sleep 2 > outfile 0.00s user 0.00s system 0% cpu 2.001 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant