I have several problems with xmr-stak 2.4.7 on CUDA 9.2
1- That code only works from within the script, if you run it individually the variable will not be recognized
2- Input for compiling xmr-stak is X (uppercase x) not x
3- I dont have much experience with xmr-stak to help with. You may ask in their from for the parameters and add them to:
XMR_EXTENSION_ARGUMENTS=""
Or let us know if it needs some adjustments in 0miner.
4- There is already a miner password in 1bash what other passwords you are looking for?
MINER_PWD="x" # Set the miner password. Default: x