Files
SwiftShell/SwiftShellTests/Scripts/print_linenumbers.swift
T
2014-10-15 23:03:42 +02:00

15 lines
239 B
Swift
Executable File

#!/usr/bin/env swiftshell
import SwiftShell
/*
var i = 1
for line in standardinput.lines() {
print("line \(i++): ")
println(line)
}
*/
var i = 1
standardinput.lines() |> map {line in "line \(i++): \(line)\n"} |> write(standardoutput)