I\'m writing a bash script which has to pass a variable to another program:
./program $variable
The problem is, it is absolutely necessary for
This is almost certainly a problem in the way you are reading the variable in your program.
For instance suppose this is your script (just one line for testing):
echo "$1"
Let's call it echo.sh. If you run echo.sh "test best"
, you will get test best
.
But if your program says
echo $1
you might get behaviour like what you're seeing.