Added check for interactive shell to README.
This commit is contained in:
parent
a3df2bcef9
commit
f6d61543a2
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user