在terminal中编写并运行swift
➜ swift $ pwd /Users/cyper/swift ➜ swift $ which swift /usr/bin/swift ➜ swift $ swift --version Apple Swift version 2.0 (swiftlang-700.0.59 clang-700.0.72) Target: x86_64-apple-darwin15.0.0 ➜ swift $ ./example.swift hi cyper ./example.swift hi cyper ➜ swift $ cat example.swift #!/usr/bin/swift // A swift comonet! import Foundation for arg in Process.arguments { print(arg) } exit(0) ➜ swift $