execvp Questions
6
I am using ubuntu 12.04. I'm trying to "make" a project.
I get this error:
g++: error trying to exec 'cc1plus': execvp: No such file or directory
I have g++ installed.
5
Solved
Is there a way to start a child process without fork(), using execvp() exclusively?
Ferreira asked 11/1, 2019 at 19:8
2
Solved
Whenever I try to compile c/cpp files it gives this error:
gcc: fatal error: cannot execute ‘as’: execvp: No such file or directory
compilation terminated.
I have also tried to include full path o...
Befool asked 28/6, 2019 at 5:6
3
I'm presently executing the following Linux command in one of my c programs to display processes that are running. Is there anyway I can modify it to show stopped processes and running ones?
char ...
2
Solved
I have to develop a simple shell in C using system calls fork()/execvp(). So far my code takes in a command, splits it up using strtok into an array argv and then I call fork to create a child and ...
2
I am dealing with a Python script which does, after some preparation work, launch ssh. My script is actually a small CLI tool. On Unix-like systems, at the end of its life, the Python script replac...
Toughen asked 3/5, 2021 at 15:27
2
Solved
The user will read a line and i will retain the first word as a command for execvp.
Lets say he will type "cat file.txt" ... command will be cat . But i am not sure how to use this execvp(), i re...
3
Solved
3
Solved
I want to pass a vector in as the second argument to execvp. Is it possible?
3
Solved
At the beginning, I wrote something like this
char* argv[] = { "ls", "-al", ..., (char*)NULL };
execvp("ls", argv);
However, GCC popped up this warning, "C++ forbids converting a string constant...
5
Solved
Does anyone know how to catch the output (I think its stdout) from execvp instead of the system printing it (in c on linux) in the terminal?
2
Solved
I've been trying to write a shell in Rust that links directly to the libc library. I've used a Vec<String> to hold the arguments to be passed to execvp(), but it seems that my conversion to c...
2
Solved
execvp is defined thus:
int execvp(const char *file, char *const argv[]);
Which precludes code such as this from being used:
const char* argv[] = {"/bin/my", "command", "here", NULL};
execvp(ar...
0
3
Answers to questions in your head: Yes, this is for school. No, I can't use threads for this. And yes, I looked for an answer and some people said "yes" and others said "no." I'm also fact-checking...
3
Solved
I'm trying to pass arguments entered by the user to execvp().
So far I've split up the string. If the user types ls -a, temp is saved as "ls" and "-a" followed by a NULL character. I'm not quite s...
3
Solved
I want to write a program Shellcode.c that accepts in input a text file, which contains bash commands separeted by newline, and executes every commands in the text file: for example, the text file ...
2
Solved
I want to simulate bash in my Linux C program using pipes and execvp function. e.g
ls -l | wc -l
There is my program:
if(pipe(des_p) == -1) {perror("Failed to create pipe");}
if(fork() == 0) ...
Trypanosome asked 10/12, 2012 at 12:42
3
Solved
Right now I'm writing a C program that must execute a child process. I'm not doing multiple child processes simultaneously or anything, so this is fairly straightforward. I am definitely executing ...
1
Solved
I have the following code.
My question is in the code
int main() {
....
if ((uproc.pid = fork()) == -1) {
return -1;
}
if (uproc.pid == 0) {
/* child */
const char *argv[3];
int i = ...
2
Solved
I am having trouble with using execvp(). execvp() expects type char * const* as second parameter. I want to parse arguments passed to application (in argv) and make an array of that type. For examp...
2
Solved
I am building a shell and am having some trouble with the system call 'execvp'. I saw some other questions on this topic but they were vague, and did not appear to be completely addressed (whoever ...
2
Solved
When I call execvp, for example execvp(echo, b) where b is an array of arguments for the command a, will changing this array later affect the execvp call made previously? When I try calling execp(e...
1
Solved
I have a server process that forks many child processes. The server process has affinity to a CPU core, but I don't want that affinity to be inherited by child process (rather OS should handle wher...
5
Solved
Say in C, I want to call execvp() on any string command. Command can just be:
char command[] = "ls -l";
char command[] = "rm *.txt";
char command[] = "cat makefile";
I want to put this command v...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.