TABLE OF CONTENTS


::pwtk::rexec

SYNOPSIS

proc ::pwtk::rexec {args} {

USAGE

   ::pwtk::rexec ?-e|-i? user_at_host command

PURPOSE

Execute the command in the foreground on the remote host.

The executable for the remote shell (default = ssh) is defined by the remote(rsh) variable in $PWTK/config/remote.tcl or ~/.pwtk/remote.tcl.

OPTIONS

ARGUMENTS

SOURCE

    variable remote

    set narg 2
    set usage "?-e|-i? user_at_host command"
    set options {
        {e "throw an error explicitly if error occurs"}
        {i "ignore errors"}
    }
    parseOpt_
    lassign $args user_at_host command    
    set flag {}
    if { $opt(e) } { set flag -e }
    if { $opt(i) } { set flag -i }; # -i has preference
    
    return [try_exec -ignorestderr {*}$flag -- {*}$remote(rsh) $user_at_host $command]
}