Execute (shell) command in an alias?

Asked by Florian Rathgeber

Is it possible to execute a shell command (similar to using `` in bash) in a bzr alias?

I tried to define an alias for "bzr vimdiff `bzr modified`" as "vd=vimdiff `bzr modified`", which didn't work, since "`bzr" and "modified`" were treated as file names. Is there another command achieving what I want? Or a different syntax for defining the alias?

Question information

English Edit question
Bazaar Edit question
No assignee Edit question
Solved by:
Parth Malwankar
Last query:
Last reply:
Revision history for this message
Best Parth Malwankar (parthm) said :

Hi Florian,

There is a extcommand plugin that was mentioned on the mailing list some time back[1]. It can be used to create aliases to external shell commands.

Specifically, for the diff case, you also have the --using option that can be used. For e.g. my aliases have the following entry.
[~]% bzr alias gvimdiff
bzr alias gvimdiff="diff --using gvimdiff"

[1] http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/51779

Revision history for this message
Florian Rathgeber (florian-rathgeber) said :

Thanks for the tip with the extcommand plugin, that works indeed!

--using only works for graphical diff tools as far as I know (that doesn't help me in this case, I'm working at the terminal)