I am trying to so something like this in my bashrc
SERVER=abc.com
geta() { scp ${SERVER}:$1 . ;}
SERVER=xyz.com
getx() { scp ${SERVER}:$1 . ;}
declare -f geta getx
geta ()
{
scp ${SERVER}:$1 .
}
getx ()
{
scp ${SERVER}:$1 .
}
What I want geta and getx to be set to is
geta () { scp abc.com:$1 . }
getx () { scp xyz.com:$1 . }
Is there a way to force variable expansion in function definitions?
Note: For clarification I changed the example
ping $SERVERisn't working for you?