You are not logged in.
Pages: 1
I've read the man and search (a lot) for options in alias, like -s, -d, -g...
So, any good manual please?
Last edited by teh (2010-06-09 04:48:23)
arst
Offline
I don't think you can do that with alias's but you can put functions in your bashrc which work the same way.
Take for instance, this:
start(){
for arg in $*; do
sudo /etc/rc.d/$arg stop
done
}
Offline
hmmm... This is what I'm talking about:
http://github.com/Barrucadu/home/blob/m … sh/aliases
I've got a hint reading commented lines: -g for Global and -s for Suffix. But still...
And this has the same options(¿?) parameters (¿?):
arst
Offline
You're using zsh, I presume?
Both of those examples are for zsh.
Offline
Now I'm lost...
Offline
Ok, nevermind... I've got it.
I didn't know that *sh lets you specify more than just a character or a string (without quotations marks) to set the alias...
Example:
alias -s pdf='zathura'
Then just type foo.pdf -s pdf and done...
So noob, sorry =P I thought those "options" was part of an alias or zsh functions.
Send this to /dev/zero please =P
Last edited by teh (2010-06-09 07:18:16)
arst
Offline
They are options for the alias:
alias -s pdf='zathura'
/path/to/file.pdf
…and zathura opens
Offline
alias -s pdf='zathura'
Then just type foo.pdf -s pdf and done...
Why do you type that last line? You should just execute
foo.pdf
and zathura should open it.
Offline
-g means global (anywhere on cmd line) and -s means suffix (use this program when i type a file name with this extension). Both are zsh features, bash has neither. These are zsh's alias flags (generated with tab completion):
-L -- print each alias in the form of calls to alias
-g -- list or define global aliases
-m -- print aliases matching specified pattern
-r -- list or define regular aliases
-s -- list or define suffix aliases
Last edited by JohannesSM64 (2010-06-13 14:15:59)
Offline
¡Thank you JohannesSM64!
arst
Offline
Pages: 1