0

I am using zsh for my shell and I have the following function defined in my ~/.zshrc to run custom commands inside my vagrant VM.

vt() {
    pushd ~/dev/vvv
    vagrant ssh -c $@
    popd
}

So to run the xdebug_on command inside my vagrant VM, I can just use the alias vt xdebug_on

I want to shorten this further and so I created another alias/function called vtxon

vtxon() {
    pushd ~/dev/vvv
    vagrant ssh -c xdebug_on
    popd
}

which is working, but I want to know if there is a way I can reuse vt alias/function vtxon instead of recreating everything.

Is it possible to do it?

Sudar
  • 18,954
  • 30
  • 85
  • 131
  • 2
    Did you try a trivial `vtxon() { vt xdebug_on }` yet? Should work as long as the called function is known in the scope. – Ext3h Jun 22 '16 at 05:09
  • Damn! you are correct! I don't know why this simple trivial thing escaped my mind. Please post it as an answer so that I can get you some karma :) – Sudar Jun 22 '16 at 05:12

1 Answers1

4

Did you try a trivial

vtxon() {
    vt xdebug_on
}

yet? Should work as long as the called function is known in the scope.

Ext3h
  • 5,713
  • 17
  • 43