0
1
Apologies for the bad title. I couldn't come up with a better one.
I want to alias a command to another command, and extract options from the text of the command itself. I realize this is unclear, so perhaps an example will help:
If i were to do something like this with ls
, I would want to be able to alias the following:
ll -> ls -l
la -> ls -a
lal -> ls -al
l -> ls
BUT
ls -> ls #allow this special case to not change
preferably, I would like to be abel to determine on my own whether to igrone part of the command, like I do with the s
in ls
. so, for example, I'd also like to be able to do with grep:
grepi -> grep -i
greps -> grep -s
grepis -> grep -is
we dont have to worry right now about options that take arguments, for example, its ok if grepm
fails.
While not exactly what you're asking, unless you have a command that frequently changes the base command name, it will likely be easier to just set up a bunch of aliases in your
.bashrc
or similar. – Darth Android – 2012-08-02T20:52:43.717