Last active
February 27, 2016 06:02
-
-
Save jakubpetrik/41e8ca03c213e5d57ec4 to your computer and use it in GitHub Desktop.
Native shebang - shell scripting in Swift (using Swift REPL)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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