You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: It might feel more intuitive to provide dependencies as an argument to `kscript`, however because of the way the shebang line works on Linux this is not possible.
61
61
62
62
63
+
64
+
Inline Usage
65
+
============
66
+
67
+
You can even inline `kscript` solutions into larger scripts, because `kscript` can read from stdin as well. So, depdending your preference you could simply pipe a kotlin snippet into `kscript`
68
+
69
+
```
70
+
echo '
71
+
println("hello kotlin")
72
+
' | kscript
73
+
```
74
+
75
+
76
+
or do the same using `heredoc` (preferred solution) which gives you some more flexibility to also use single quotes in your script:
77
+
```
78
+
kscript - <<"EOF"
79
+
println("hello kotlin and heredoc")
80
+
EOF
81
+
```
82
+
83
+
Since the piped content is considered as a regular script it can also have dependencies
0 commit comments