I have a script that takes a command and executes it on a remote host. It works fine, for example:
$ rexec "ant build_all"
will execute the "ant build_all" command on the remote system (passing it through SSH, etc).
Because I'm lazy, I want to set up an alias for this command (and ultimately, several others), such that, for example, I can just invoke
$ rant build_all
and bash will it will automatically invoke
$ rexec "ant build_all"
I tried doing this with alias, but if I define
alias rant=rexec ant
then any arguments passed to "rant" will just be appended to the end, like so:
$ rant build_all -Dtarget=Win32
(interpreted as:)
$ rexec "ant" build_all -Dtarget=Win32
This fails, because rexec really takes just one argument, and ignores the others.
I could probably do this with a bash wrapper script, but I was wondering if bash had any built-ins for doing this for me, perhaps a named-argument version of alias, or a perl-like quote string command (e.g. qw/ / ), or some such.