Swift as a shell-like interpreted language

Firstly you need to setup your environment to use the new Xcode 6

sudo xcode-select --switch /Applications/Xcode6-Beta4.app/Contents/Developer

Next you can now use this in the top of your Swift scripts

#!/usr/bin/env xcrun swift -i

Now it’s playtime!

[peacock@trashcan ~]$ cat helloworld.swift 
#!/usr/bin/env xcrun swift -i

println("Hello, World")
[peacock@trashcan ~]$ ./helloworld.swift 
Hello, World