Created
July 17, 2009 13:13
-
-
Save loverdos/149043 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if(2 != args.length) { | |
System.err.println("Usage: change-path-element in-elem out-elem") | |
System.exit(1) | |
} | |
val In = args(0) | |
val Out = args(1) | |
//println("In = " + In) | |
//println("Out = " + Out) | |
val Path = System.getenv("PATH") | |
val PathSep = System.getProperty("path.separator") | |
//println() | |
//println("PATH = " + Path) | |
val NewPath = Path.split(PathSep) map { elem => | |
if(elem == In) Out else elem | |
} mkString PathSep | |
//println() | |
print(NewPath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment