Skip to content

Instantly share code, notes, and snippets.

@duboisf
Created April 28, 2010 12:33
Show Gist options
  • Save duboisf/382077 to your computer and use it in GitHub Desktop.
Save duboisf/382077 to your computer and use it in GitHub Desktop.
tail.scala
import scala.io.Source
import java.io.File
object Tail {
def main(args: Array[String]) {
val filesource = Source.fromFile(new File(args(1)))
val lines = filesource.getLines().toList
lines.drop(lines.length - args(0).toInt).map(println)
filesource.close()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment