From d4acc4cd8083c232387c3ebb78178c5032e0b06f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 8 Feb 2025 20:47:01 +0100 Subject: Add SSHEXEC_SSH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- README | 4 ++++ sshcd.1 | 7 +++++++ sshexec.1 | 7 +++++++ sshexec.c | 7 +++++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README b/README index 8476cee..25af146 100644 --- a/README +++ b/README @@ -158,6 +158,10 @@ ENVIRONMENT VARIABLES variable affects where the sshexec utility can find the ssh(1) utility or ssh-command. + SSHEXEC_SSH + If set and non-empty, it overrides the default value of + ssh-command from ssh to the value of the variable. + SSHEXEC_OPTS_NO_ARG List of options that sshexec shall interpret as ssh(1) options that do not have any argument. (Default is diff --git a/sshcd.1 b/sshcd.1 index 7b5ede4..d2a0265 100644 --- a/sshcd.1 +++ b/sshcd.1 @@ -140,6 +140,13 @@ to tell SSH to allocate a pseudo terminal. If unset will be used. If set but empty, no flag will be passed to .BR ssh (1). .TP +.I SSHEXEC_SSH +If set and non-empty, it overrides the default value of +.I ssh-command +from +.B ssh +to the value of the variable. +.TP .I SSHEXEC_OPTS_NO_ARG List of options that .B sshexec diff --git a/sshexec.1 b/sshexec.1 index 9f37962..dc42392 100644 --- a/sshexec.1 +++ b/sshexec.1 @@ -296,6 +296,13 @@ utility can find the utility or .IR ssh-command . .TP +.I SSHEXEC_SSH +If set and non-empty, it overrides the default value of +.I ssh-command +from +.B ssh +to the value of the variable. +.TP .I SSHEXEC_OPTS_NO_ARG List of options that .B sshexec diff --git a/sshexec.c b/sshexec.c index 7ed551a..bc02987 100644 --- a/sshexec.c +++ b/sshexec.c @@ -480,8 +480,11 @@ parse_sshexec_options(char *argv[]) end_of_options: /* Parse options and set defaults */ - if (!ssh) - ssh = "ssh"; + if (!ssh) { + ssh = get("SSHEXEC_SSH", ""); + if (!*ssh) + ssh = "ssh"; + } if (!cd) strict_cd = !is_sshcd; -- cgit v1.2.3-70-g09d2