1

I am new to scala and this question is simple parameter passing to another command.

val p = "/usr/tmp"

val status = Seq("/bin/sh", "-c", "rm -f $p/*.txt").!

the $p value seems to be not passing correctly, can some one please help me understand on how to pass val p as a param to next val command.

1 Answer 1

3

Your string needs to start with 's' to use string interpolation

val status = Seq("/bin/sh", "-c", s"rm -f $p/*.txt").!
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.