|
|
|
|
|
by yareally
4586 days ago
|
|
Scala does something similarly neat with using #| for piping system commands. Slash for Scala is not used by default though for path joining, but it can be by adding an implicit function: implicit def slash(str: String) = new { def /(joinStr: String) = str + java.io.File.separatorChar + joinStr}
val joinedStr = "abc"/"def"/"ghi"
> joinedStr : java.lang.String = abc/def/ghi
Shell friendly syntax can be used for stdin/stdout in Scala as well (already in the stdlib with no implicits required):#< Redirect STDIN #> Redirect STDOUT #>> Append to STDOUT #&& Create an AND list #!! Create an OR list http://stackoverflow.com/questions/12772605/scala-shell-comm... http://alvinalexander.com/scala/scala-execute-exec-external-... |
|