javascript - Running Bash Scripts with arguments through node.js -
im trying run bash script through node.js child_process
the part not working in bash script when running line
(echo "password"; echo "password"; echo "name"; echo "organization"; echo "organization"; echo "ciudad"; echo "region"; echo "pais"; echo "yes";echo) |keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg rsa -keysize 2048 -validity 10000
basically, i'm trying answer different options when i'm running keytool not working (the process stuck waiting option)
in node running
exec('./script.sh', { cwd: '/users/my/directory' }, (error, stdout, stderr) => { if (error) { console.error(`exec error: ${error}`); return; } console.log(`stdout: ${stdout}`); console.log(`stderr: ${stderr}`); }).stderr.pipe(process.stderr);
is there solution this?
thanks
this wont work each echo happens , last echo piped program.
the way handle expect
.
see https://linux.die.net/man/1/expect
also can use -dname
flag set these fields. way cleaner dealing interactive prompts.
"cn=mark jones, ou=java, o=oracle, c=us"
Comments
Post a Comment