bash - Passing Arguments Through system() in C++ -
how pass command line variable though system() command in c++. have tried using:
string i; = system("./findname.sh"); += argv[1]; cout << i;
but when run gives me condition wrong number of arguments have written in shell script.
this output received when running program "./findname brandonw". executable file ran argument want shell script run with.
the arguments put are: brandonw usage: findname.sh [only_one_argument]
just concatenate command string.
string command = "./findname.sh"; command = command + " " + argv[1]; system(command.c_str());
Comments
Post a Comment