[英]Running javascript from a bash script
我是學習 bash 腳本編程的新手,想知道這里是否有人知道如何執行通常會嵌入到 html 頁面中的 javascript?
因此,從 bash 腳本中,我想執行(例如):
<script type="text/javascript" src="scriptName.js"></script>
非常感謝任何人的幫助。
如何使用 env 像:
我的檔案
#!/usr/bin/env node
console.log("hello from test file");
使文件可執行。
chmod +x my-file
然后運行它:
node my-file
hello from test file
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.