I have a function I found online to add to my .bashrc which spawns a new SSH session with the hostname:
# Opens SSH on a new screen window with the appropriate name.
screen_ssh() {
numargs=$#
screen -t ${!numargs} ssh $@
if [ $TERM == "screen" -o $TERM == "screen.linux" ] && [ ! -z "$PS1" ]; then
alias ssh=screen_ssh
fi
if [[ $- == *i* ]]
then
[ "$STY" ] && ssh() { screen -t "${1##*@}" ssh "$@"; } # Spawn new window in Screen for SSH
fi
but it will also do this for aliases, like so:
lsrem(){ ssh $1 "ls -l" ; }
so my question is how to stop it from working with aliases/functions and only work interactively for:
ssh somehost
Thanks in advance.