I wish to find the current username in scala.
On the command line I can do:
whoami
In python, I can do:
import getpass
user_name = getpass.getuser()
How do I find the username in Scala?
I wish to find the current username in scala.
On the command line I can do:
whoami
In python, I can do:
import getpass
user_name = getpass.getuser()
How do I find the username in Scala?
You can use the Java API for this:
System.getProperty("user.name")
See more (Java) options here: Get login username in java