How do you mix BASH with C. What I am trying to do is with a c-program take input into two arrays and then send them into any BASH command and execute the command. I have tried doing it with copy but with no luck.
Code:#include <stdio.h> #include <stdlib.h> int main(void) { char name1[20]; char name2[20]; printf("Please enter two names.\n"); scanf("%s %s", name1, name2); system("cp name1 name2"); return 0; }