Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fs exec child process

const { exec } = require('child_process');

exec('"/path/to/test file/test.sh" arg1 arg2');
// Double quotes are used so that the space in the path is not interpreted as
// a delimiter of multiple arguments.

exec('echo "The $HOME variable is $HOME"');
// The $HOME variable is escaped in the first instance, but not in the second.
Source by nodejs.org #
 
PREVIOUS NEXT
Tagged: #fs #exec #child #process
ADD COMMENT
Topic
Name
7+4 =