alias two words or more
Hi. I think this question is kind of stupid. Usually when you set alias in your ~/.bashrc file, you make it consist of one word like this:
alias rm='rm -i' But what if I want to make the alias to consist of two words or more. I've tried this: alias remove\ junks='rm -i' alias "remove junks"='rm -i' alias 'remove junks'='rm -i' And I want space between the words so that when I type something like: Code:
remove junks junk.file Code:
rm -i junk.file |
I'm not an alias expert but feel that wouldn't work out so well.. why not just write a basic shell script to do this, with options, etc?
|
rm is short for remove so your theory of making a two word alias does not make much sense to me. In fact you unaliasing in this case. And yes I beleive the built in command for alias does not accept two arguments:
alias [-p] [name[=value] ...] |
Quote:
|
You could use `remove_junk` then hopefully when you type "rem"+TAB you should get what you want. Pretty silly if you ask me. But you may have some other function for this in mind'
|
Yeah! Just to make the command line to understand normal words:). Even when I make a script 'remove junk', I cannot run it unless I put the '\' in between. I think I should make a script that accept command from echo -n instead. Thanks guy.
|
All times are GMT -5. The time now is 01:08 AM. |