I want to understand how this Scala script works:
#!/usr/bin/env bash
exec scala "$0" "$@"
!#
object HelloWorld {
def main(args: Array[String]) {
println("Hello, world! " + args.toList)
}
}
HelloWorld main args
On line 3, what is "!#" doing? Is the remainder of the file then fed to standard input of the Scala program? Also, is '!#' documented anywhere?
NB: The nearest thing I could find, although it is not directly relevant in any way is Stack Overflow question Why do you need to put #!/bin/bash at the beginning of a script file? (about the beginning of a Bash script).
1. something used for or regarded as representing something else; a material object representing something, often something immaterial; emblem, token, or sign. 2. a letter, figure, or other character or mark or a combination of letters or the like used to designate something.
What Does :/ Mean? :/ is an emoticon used to indicate indecision, skepticism, exasperation, and annoyance. The emoticon :/ is one of the most difficult to define. It can indicate a wide range of emotions, including (but not limited to) indecision, skepticism, exasperation, and annoyance.
Methionylthreonylthreonylglutaminylarginyl… isoleucine is the chemical name for the protein of “titin” also known as “connectin.” The largest known protein that consists of 26, 926 amino acids is made up of 189, 819 letters and can take about three hours to pronounce.
Pneumonoultramicroscopicsilicovolcanoconiosis is the longest word entered in the most trusted English dictionaries.
From the original documentation:
Script files may have an optional header that is ignored if present. There are two ways to format the header: either beginning with #! and ending with !#, or beginning with ::#! and ending with ::!#.
So the following code is just a header for a Scala script:
#!/usr/bin/env bash
exec scala "$0" "$@"
!#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With