简体   繁体   中英

how to find user home path using eclipse command line script in RCPTT?

Like we have some scripts to find eclipse installed location as {workspace_loc}. I've tried with some more syntax but none of them show me a way.

This ECL script below works if your program is started with a workspace in the user's library. It's Windows only; if you need Unix-based solution simply change the "\\\\" literals to "/" literals.

/* Stores User's home path into global "user_home" if workspace location is within the user folder.  */
proc introduce_user_home {
    // Splitting up workspace path
    let [val splitted [get-workspace-location | split -sep "\\" | to-list]] {
        let [val user_part
            // Concatenating the part that matters
            [concat [$splitted | get 0 | str] // C:
                    "\\"
                    [$splitted | get 1 | str] // Users
                    "\\"
                    [$splitted | get 2 | str] // Jagadeesh
            ]] {
                get-window $user_part
                // Introducing it as a global
                global [val "user_home" [$user_part]] -override true
            }
    }
}

I found myself a way to locate user directory using environment variables

substitute-variables "${system_property:user.home}"

Above code is locating user directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM