Hello, everybody!
Here's a part of the code from a program I'm trying to do:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main (int argc, char* argv[]) {
.....
system("clear");
system("rm something");
system("cp something_else something");
.....
.....
.....
system("source something");
}
Now why on Earth doesn't the source command work? It works perfectly when I write it in the console. The other commands I gave using system() (clear, rm and cp) worked just fine. But when I try it through a system function I get:
sh: source: not found
And I've tried this even after I gave the bash command (to be sure I'm in bash).
I've also tried the . (dot) version but it gives me an error too. The file I need to source to is a simple plain text file without any extension to the name (as I said source <that_file> works fine in console.
Note: I'm doing this on Ubuntu and compiling with gcc -o test test.c
Thank you in advance,
Adrian Chitan