Last active
December 10, 2015 02:28
-
-
Save grantm/4367372 to your computer and use it in GitHub Desktop.
Ever forgotten the ':' after the hostname of an scp command?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mine from KSH .profile:
wscp()
{
if [[ "$@" = +(:) ]];then
/usr/bin/scp "$@"
else
echo 'You forgot the colon dumbass!'
fi
}
alias scp=wscp