Is it possible to call javascript inside a shell script? For example,
echo "Content-type: text/html"
echo "
<html>
<script type="text/javascript">
document.write("<p>" + Date() + "</p>");
</script>
</html>
"
Is it possible to call javascript inside a shell script? For example,
echo "Content-type: text/html"
echo "
<html>
<script type="text/javascript">
document.write("<p>" + Date() + "</p>");
</script>
</html>
"
By default: No. But you could install applications that can run javascript like node.js or rhino.
node name_of_script.js.If your script is used by CGI (Common Gateway Interface) application, then yes, you can include HTML with embedded JavaScript.
EDIT: JavaScript is a client-side technology. You won't get any trace of JavaScript running on server, because it won't be executed on server (unless we're talking about Server Side JavaScript but I don't think so).
You'll need to install a javascript engine on your system to be able to call it from bash and execute your javascript code. Check SpiderMonkey.