Created
June 5, 2018 20:58
-
-
Save NielsRenard/9377d6b85a7c51b6bfbf78fab4046a05 to your computer and use it in GitHub Desktop.
read files from commandline in kotlin
This file contains 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
#!/bin/bash | |
kotlinc FileReader.kt -include-runtime -d FileReader.jar |
This file contains 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
import java.io.File | |
fun main(args: Array<String>){ | |
print(File(args[0]).readText()) | |
} |
This file contains 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
#!/bin/bash | |
if [[ $# -gt 0 ]]; | |
then | |
java -jar FileReader.jar $1 | |
else | |
echo 'provide a file path' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment