All Questions
221
questions
2
votes
1
answer
96
views
(Bad file descriptor error) Pipe between a execl() C and a Python in Python program
I tried to exchange a string between Python and C programs using a pipe(), but I got nothing.
After that I tried to exchange a string between two C programs using a pipe() and everything was fine.
...
1
vote
1
answer
83
views
No bytes received using pipes and execve
I'm attempting to use pipes to send some data to child processes. After forking, I call execve, which works correctly, but I still can't receive any bytes from the pipe. I don't know what I'm missing. ...
0
votes
1
answer
108
views
Execute python file in cpp
I want to execute a python file in cpp, to make it a process that can communicate with my other child process. But when I use
execl("python3", "python3", "python/a1.py");
...
0
votes
1
answer
96
views
C program with forks only prints output if I don't use wait()
I'm writing some programs in C to learn about child processes and I'm having a little trouble with the code below. The idea is to simulate bash commands with pipes using exec, unnamed pipes and copy2, ...
0
votes
1
answer
80
views
Using `pipe`, `dup2` to duplicate an `exec`ing childs STDOUT - output only shows up when child exits
I've read all the answers for this question on this site and they're all wrong (i.e. flat out does not work, or doesn't do what I want it to).
I have a tracer program, that wants to be able to control ...
2
votes
1
answer
126
views
Trying to code a mini Linux shell in C - any idea why my pipe executes won't work?
Just a little background: the user enters a command\series of commands when each one of them separated with ';'. Then a function gets the input, copies the string until next ';' or end-of-string, and ...
-1
votes
1
answer
53
views
Parent process kill() child process but then doesn't respond to read() or printf()?
When the child process executing the program a is sent the signal SIGTERM, it should output to the stdout just before terminating. But my read() in (signal == 1) is running? I get no output from the ...
1
vote
1
answer
201
views
Issue implementing command pipes in a simple shell program
I'm writing a very simple bash-like shell in C and am currently implementing pipes between commands (i.e. command1 | command2, which should run both commands at the same time with the stdout of the ...
0
votes
0
answers
30
views
problem parsing a file and then executing 2 commands in pipe
I am making a program in which I need to read from a file and execute the command in pipe. The command could be something like "ps -lu user | sort", and I should execute the first command ...
1
vote
1
answer
608
views
Execute with pipe in c
A problem was issued during the production of the minishell, using pipe() and fork() to apply the pipeline, while producing code that performs the same role as "command | command" in bash
...
0
votes
1
answer
63
views
Talk interactively in C with another C program on Linux not working
I am trying to talk interactively with a C executable on Linux (give input on stdin and read output from stdout).
I am using a C program host.c and talking to a compiled executable target.c.
However, ...
0
votes
0
answers
47
views
Trouble with execlp() and "cut" bash command: additional blank line added
I have a C program where the father process creates two children processes: the first child needs to read from an existing text file, and using execlp("cut","cut", options...) it ...
0
votes
1
answer
51
views
How to properly apply for a second time dup2()?
Goal: having a program alterna that, according to an integer, particularly reads from STDIN_FILENO and writes on STDOUT_FILENO, write a program that accepts 3 arguments: a text file, two integers r1 ...
0
votes
1
answer
279
views
Use execve with argv (Piping)
I got the piping of several commands working. Now Id like to execute this with received arguments (*argv[]) and not hard coded like here.
Ived tried using the rest of the execve family but no progress....
-1
votes
1
answer
128
views
grep exec on a File Content in C
I am trying to apply the grep on file content using excel. But, it is not working. I am stuck on it. I don't know how to get the content of the file in the exec call.
#include <stdio.h>
#...