TABLE OF CONTENTS


::pwtk::resolve_ssh_alias

SYNOPSIS

proc ::pwtk::resolve_ssh_alias {hostAlias} {

PURPOSE

Resolve a ssh alias and return the hostname, i.e., map from the ssh alias to the hostname.

SOURCE

    set output [try_exec -e ssh -G $hostAlias]
    set index  [lsearch -exact -nocase $output hostname]
    if { $index > -1 } {
        return [lindex $output $index+1]
    }
    # just in case (if hostAlias==user_at_host, return host)
    return [lindex [split $hostAlias @] end]
}