0

See the following script from scala tutorial, What does the !# mean?

#!/bin/sh
exec scala "$0" "$@"
!#
object HelloWorld extends App {
  println("Hello, world!")
}
HelloWorld.main(args)
Piotr Praszmo
  • 17,928
  • 1
  • 57
  • 65
wang zhihao
  • 201
  • 2
  • 14
  • [What is the meaning of !# (bang-pound) in a sh / Bash shell script?](http://stackoverflow.com/questions/10060419/what-is-the-meaning-of-bang-pound-in-a-sh-bash-shell-script#10060452) – Zernike Jul 19 '15 at 08:06

2 Answers2

1

See: http://www.scala-lang.org/files/archive/nightly/docs-master/manual/html/scala.html

#! and !# mark script header. All content between those marks are ignored by scala interpreter. In that section you can put shell script which will launch the actual scala script.

Piotr Praszmo
  • 17,928
  • 1
  • 57
  • 65
0

The !# is called a "bangshe" (opposite of a "shebang"). It is a bit like a closing brace on the header statement.

sudo make install
  • 5,629
  • 3
  • 36
  • 48