I have small client program that uses rsh to get the inode number for a file. The problem I face is the rsh command is getting executed but there is no output is read by the parent.
If I run any command lets say "ls" that is executed locally, I can see the output.
/* Child */
close pipe[0];
dup2(pipe[1],STDOUT_FILENO);
execv("/usr/bin/rsh","ls","-i","a.txt");
/* Parent */
close pipe[1]
bytes = read pipe[0]
/* bytes always is 0. But if I have ls executed by child,
* I can see full output */