I want to define a variable in a shell script that I pass to a c++ executable. At the moment my shell script looks like,
#!/bin/sh
aTest="hello"
echo $aTest
./hello $aTest
which I use to run an executable for a c++ program,
#include <iostream>
using namespace std;
int main()
{
string aString;
cin>>aString;
cout << aString << endl;
}
However when I run the shell script from bash it just hangs, until I give it a parameter on bash.
Any ideas how can I get this to work as I would like?