Added check for interactive shell to README.

This commit is contained in:
Stefan Gaiselmann 2020-11-09 16:48:28 +01:00
parent a3df2bcef9
commit f6d61543a2

View File

@ -51,6 +51,14 @@ Alternative way to include .sshrc by detecting SSH connection.
[source,bash] [source,bash]
---- ----
# User specific aliases and functions # 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 if [ -f ~/.sshrc ] && [ -z "$SSH_CLIENT" ]; then
echo "Not a ssh connection" echo "Not a ssh connection"
else else