Last active
February 26, 2018 09:05
-
-
Save 4O4/b4e71ab04625df70979ce6d3a7f5801f to your computer and use it in GitHub Desktop.
Get value of environment variable from remote server. Wrapper around remote_exec gist (https://gist.github.com/4O4/18b69f34001439a2b01532c1ae377aa2)
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
| #!/usr/bin/env bash | |
| # Get remote_exec.sh from another gist: https://gist.github.com/4O4/18b69f34001439a2b01532c1ae377aa2 | |
| source remote_exec.sh | |
| get_remote_var() { | |
| remote_exec ${1} "echo -n \${${2}}" | |
| } | |
| # Usage example | |
| REMOTE_JAVA_TOP=$(get_remote_var user@example.com JAVA_TOP) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment