I'm trying to make a bash function as follows:
- Will SSH into a server and chdir to ~/projects
- If you pass extra arguments ('git pull'), these will be executed. If not, skip step 2
- Leaves you with a bash shell
Right now, I have this:
function xyz {
ssh -t xyz.com 'cd ~/projects; $*; bash'
}
Using this, running 'xyz' leaves me with a shell at xyz.com:~/projects, just like I want, but running 'xyz git pull' yields the following error:
/usr/bin/git: /usr/bin/git: cannot execute binary file
I'm sure I'm missing something simple, can anyone point me in the right direction?
Thanks!
$*;and execute thegit pullby hand without error? – retracile Dec 2 '09 at 19:23