I'm trying to get the value of a variable outside the function, but it always return undefined
I tried with callback but when I run the script it return callback is not a function
const exec = require('child_process').exec;
let data;
const command = "df -g | awk '$4+0 >= 80 { print $4, $7 }' | sort -n";
let exe = exec("ssh user@sistemName " + command, function (error, data, stderr ) {
});
console.log(data);
I expect value of file systems that are > than 80%