var exec = require('child_process').exec;
setInterval(function() {
exec('ls -l', function (error, stdout, stderr) {
console.log(stdout);
});
}, 3000);
On Sunday, June 30, 2013 11:23:06 PM UTC+3, jerome wrote:
>
> Hi, someone, maybe a lot of someones, are going to think this is
> ridiculously basic.
>
> But. I would like to write a node script that executes a command-line
> (bash command-line) single line of code on a setInterval. I thought it
> would be cool to write this in a JavaScript file that I could execute on a
> node server, instead of trying to write it in a bash file.
>
> Anyway, I'm sure there's a simple, straightforward and expected "norm" way
> to do this, so a pointer or two is all I'm looking for.
>
> Thanks in advance.
>
> --
> Regards,
> Jerome
> Music <http://www.jeromecovington.com/music/> || Web
> Dev<http://www.jeromecovington.com/dev/>
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.