Shelljs exec command doesnot take variables. I tried all possible combinations like using double quotes, single quotes, assigning $ in front of the variable etc. below is the script:
#!/usr/bin/env node
require('shelljs');
for(let i = 0; i < data.length; i++)
{
let dev = data[i];
let platform_version = exec('adb -s $dev', {silent:false}).stdout;
}
error : dev not found or adds all the help commands of adb and prints out.
can anyone please help ? Thanks
note: adb is an android tool. you can use any simple commandline like echo etc