我是学习bash脚本编程的新手,想知道我是否知道如何执行通常嵌入到html页面的javascript?
所以从bash脚本开始,我想执行(例如):
<script type="text/javascript" src="scriptName.js"></script>
非常感谢任何人的帮助。
答案 0 :(得分:9)
答案 1 :(得分:0)
使用 env 怎么样:
我的文件
#!/usr/bin/env node
console.log("hello from test file");
使文件可执行。
chmod +x my-file
然后运行它:
node my-file
hello from test file