/
tmpl.js
33 lines (26 loc) · 838 Bytes
/
tmpl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env node
var child_process = require('child_process');
var argv = process.argv;
argv.shift();
var file_path = __dirname;
var current_path = process.cwd();
if ( argv.length > 1 ) {
var first_arg = argv[0];
if ( first_arg == '-h' || first_arg == '--help' ) {
}
}
// execFile: executes a file with the specified arguments
child_process.exec('cat *.js bad_file | wc -l',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
// execFile: executes a file with the specified arguments
// child_process.execFile(file_path + '/bson.sh',null,{cwd:current_path},function (error,stdout,stderr) {
// if (error !== null) {
// console.log('exec error: ' + error);
// }
// });