Last active
May 24, 2017 09:29
-
-
Save Ismael-VC/6db0c310eaf04d0b0a1b to your computer and use it in GitHub Desktop.
Julia user configuration file.
This file contains 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
const HOSTS = ASCIIString["hd$(i)" for i = 1:19] | |
const SEPARATOR = "#" ^ 79 | |
separator() = (println(); print_with_color(:cyan, SEPARATOR); println()) | |
function ssh_all(command, commands...; hosts=HOSTS) | |
separator() | |
for host in hosts | |
println() | |
@show host | |
println() | |
cmd = `ssh $host $command` | |
if !isempty(commands) | |
for c in commands | |
cmd = cmd |> c # pipe commands | |
end | |
end | |
run(cmd) | |
separator() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment