Reputation: 81
I am new to learning bash script programming and was wondering if anyone here knows how can I execute javascript that would normally be embedded into an html page?
So from a bash script, I would like to execute ( for example ):
<script type="text/javascript" src="scriptName.js"></script>
Thank you very much for anyone's help.
Upvotes: 8
Views: 32231
Reputation: 32721
How about using env like:
my-file
#!/usr/bin/env node
console.log("hello from test file");
Make the file executable.
chmod +x my-file
Then run it:
node my-file
hello from test file
Upvotes: 4