I have a Javascript file with the below code snippet :
var test = "printValueInBashScript"
I have a bash script with the below snippet :
#!/bin/bash
node app.js
echo "test :: ${test}" #I know this is wrong
I want the test value coming from the js file app.js to be fetched in the bash script. As you can see I am running the app.js using node in bash. How can I store the test variable value of JS in the bash script so that I can use it for further processing?