Execute (shell) command in an alias?

Asked by Florian Rathgeber on 2010-08-02

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

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Parth Malwankar
Solved:
2010-08-02
Last query:
2010-08-02
Last reply:
2010-08-02
Best Parth Malwankar (parthm) said : #1

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

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)