UNIX COMMANDS
#include <stdio.h> main() { char str[10]; int pid; pid=fork(); if(!pid) { printf("child process"); printf("enter the command"); scanf("%s",&str); system(str) printf("finished with child "); } else wait(); retrun(0); }output:-
child process:-
enter the command
ls -l
with this output i m just getting file names ...but i need ls -l --- lists files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified.
0