10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
If I write in a c file :
execlp("date","date",NULL);
printf("A\n");
And then run through the terminal would "A" be printed ?
I understood that execlp will exit the program after it finished so the next lines of code won`t be executed afterwards.. Is that true ? (1 Reply)
Discussion started by: uniran
1 Replies
2. Shell Programming and Scripting
Hello,
From the URL
https://www.unix.com/shell-programming-scripting/121303-remove-path-path-environment-variable-2.html
I got a function to remove the directories from a path. but looks like this isnt quite working.. i am also not able to post the comments in the thread as it is closed.
... (6 Replies)
Discussion started by: satishkumar432
6 Replies
3. Programming
Hi, I have two programs, one is named "Master" and the other one "slave". What I want to do is , when I execute Master, inside slave will be called by excecl, do some calculations, and send those to the master program... A little example of what I am failing to do:
if ((PID1=fork())==0) { //... (6 Replies)
Discussion started by: lamachejo
6 Replies
4. Programming
when execl fails using the command lss, it doesnt go into the next line
execl("/bin/sh", "/bin/sh", "-c", command, NULL);
perror("execl failed"); exit(127);
for some reason the child process just stops and also the parent process also stops
so the line after the line that... (3 Replies)
Discussion started by: omega666
3 Replies
5. Red Hat
how to use find command in execl function,
I used:
execl("/usr/bin/find","find","~","-name","filename.c",0); but it shows
find: ~ no file and directory i need to get the path of the file from the home .:wall: (2 Replies)
Discussion started by: Mahendravarma
2 Replies
6. Programming
hello everybody
how can i time the execution of execl() command inside my C code?
for example, i wrote..
execl("md5sum","md5sum","myprog",NULL);
i want to count the duration of the execl command!
thanx in advance! (2 Replies)
Discussion started by: nicos
2 Replies
7. Programming
Hi,
we would appreciate if any one answer the below query.
void main()
{
printf(“ I am in main\n”);
execl(“/HOME/source/file2”,” /HOME/source/file2”,1,0);
printf(“after execl\n”);
}
How to step the file2 source code in GDB. (2 Replies)
Discussion started by: RAMESHPRABUDASS
2 Replies
8. Shell Programming and Scripting
I want to make simultanous sh commands in an exec command
for example I want to counts the lines in a file
wc -l my file.txt | awk -F" " '{print $1}'` works fine in sh but I want to implement it in a c code
the first part works like this
execl("/usr/bin/wc", "wc", "-l", "myfile.txt",... (1 Reply)
Discussion started by: walnut
1 Replies
9. Programming
can anyone explain how to pass arguments of a program in execl function
pls explain with a sample code. (2 Replies)
Discussion started by: bankpro
2 Replies
10. Programming
Hi,
Is it possible to run a program from my C program using only the full pathname?
for example if I wanna call: "ls", so I whould have to use:
execl("/bin/ls", "ls", NULL);
Is it possible to do this using only:
"/bin/ls"
thanks (1 Reply)
Discussion started by: owijust
1 Replies