# Functions declared .bashrc doesn't work in ssh command



## salem (Jun 2, 2011)

Is it possible to invoke the function declared in ~/.bashrc (or another file in the destination computer) from an inline ssh command like [cmd=]$ ssh computer function_test[/cmd] with the bash version (4.1.9(0)-release) on FreeBSD 7.3?

Defining the aliases in ~/.cshrc with tcsh it was possible to use it in a standard login as well as passing the command directly in the argument of ssh. After that I have set bash as standard shell: function and aliases are executed/expanded only if they are executed after the login in ssh \.

For example:

```
$ ssh computer [I]ENTER[/I]
$ function_test [I]ENTER[/I]
```
 
Surfing the net I've read that many people found the solution for this problem defining the function in the ~/.bashrc file, and effectively in Mac OSX, Fedora and Ubuntu this approach was effective, but in FreeBSD and Slackware it wasn't.


----------

