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
- -e ... throw an error if error occurs
- -i ... ignore error(s)
ARGUMENTS
- user_at_host ... a host specs where to execute a command (either user@hostname.domainname, hostname.domainname, or hostname)
- command ... command to execute on remore host
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] }