Skip to content

Instantly share code, notes, and snippets.

@grantm
Last active Dec 10, 2015
Embed
What would you like to do?
Ever forgotten the ':' after the hostname of an scp command?
# a useful addition to anyone's .bashrc
#
# Note, you don't want this function in effect on the remote host side of the scp transfer,
# so make sure to only define it for interactive shells, e.g.: wrap with: if [ ! -z "$PS1" ]
function scp() {
if echo "$@" | grep -q ':'
then
/usr/bin/scp "$@"
else
echo -e "\e[31;1mYou want to put your what in my where!?!?\e[0m"
fi
}
@kramse

This comment has been minimized.

Copy link

@kramse kramse commented Mar 6, 2014

mine from KSH .profile:
wscp()
{
if [[ "$@" = +(:) ]];then
/usr/bin/scp "$@"
else
echo 'You forgot the colon dumbass!'
fi
}
alias scp=wscp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment