Skip to content

Instantly share code, notes, and snippets.

@jakubpetrik
Last active February 27, 2016 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakubpetrik/41e8ca03c213e5d57ec4 to your computer and use it in GitHub Desktop.
Save jakubpetrik/41e8ca03c213e5d57ec4 to your computer and use it in GitHub Desktop.
Native shebang - shell scripting in Swift (using Swift REPL)
/**
http://rosettacode.org/wiki/Native_shebang#Swift
In short: Use the specimen language (native) for "scripting".
Usage:
./echo.swift Hello, world!
Output:
Hello, world!
*/
#!/usr/bin/swift
import Foundation
print(Process.arguments.dropFirst().joinWithSeparator(" "))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment