Why does Scala use a reversed shebang (!#) instead of just setting interpreter to scala

前端 未结 3 1066
南方客
南方客 2020-12-11 16:34

The scala documentation shows that the way to create a scala script is like this:

#!/bin/sh
exec scala \"$0\" \"$@\"
!#
/* Script here */

I

3条回答
  •  一个人的身影
    2020-12-11 17:12

    Scala did not always support /usr/bin/env. No particular reason for it, just, I imagine, the person who wrote the shell scripting support was not familiar with that syntax, back in the mid 00's. The documentation followed what was supported, and I added /usr/bin/env support at some point (iirc), but never bothered changing the documentation, it would seem.

提交回复
热议问题