Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var sys = require('sys')
- var exec = require('child_process').exec;
- var path = Math.floor(Math.random()*101)
- var fs = require('fs');
- fs.readFile('/home/shoutcast/mkdir.sh', function (err, data) {
- if (err)
- throw err;
- if (data)
- console.log(data.toString('utf8'));
- var result = data.replace(NEWDIR=TEST, 'NEWDIR=YES');
- }
- fs.writeFile(data, result, function (err) {
- if (err) return console.log(err);}
- );
- function puts(error, stdout, stderr) { sys.puts(stdout) }
- exec("bash /home/shoutcast/mkdir.sh", puts);
- fs.writeFile(data, result, function (err) {
- ^^
- SyntaxError: Unexpected identifier
- Trying to write the replacement. I tested this script out with just reading and it functioned fine. (Up to first closing bracket)
Advertisement
Add Comment
Please, Sign In to add comment