From f6d61543a21954d6ca668c65ed71cfc617cc7349 Mon Sep 17 00:00:00 2001 From: Stefan Gaiselmann Date: Mon, 9 Nov 2020 16:48:28 +0100 Subject: [PATCH] Added check for interactive shell to README. --- README.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.adoc b/README.adoc index 58891a6..4d17b83 100644 --- a/README.adoc +++ b/README.adoc @@ -51,6 +51,14 @@ Alternative way to include .sshrc by detecting SSH connection. [source,bash] ---- # User specific aliases and functions + +# test if the prompt var is not set +# See https://unix.stackexchange.com/questions/154395/running-scp-when-bashrc-of-remote-machine-includes-source-command +if [ -z "$PS1" ]; then + # prompt var is not set, so this is *not* an interactive shell + return +fi + if [ -f ~/.sshrc ] && [ -z "$SSH_CLIENT" ]; then echo "Not a ssh connection" else