Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Suffix aliases are the only reason I'm considering to switch to ZSH but I want to stick with bash. So is it possible to have something like suffix aliases in bash?

For those that doesn't know what a suffix alias is, the following in ZSH

alias -s cpp=vi
filename.cpp

will run vi with filename.cpp as first argument

Note that something like xdg-open or gnome-open is not sufficient, I want bash to execute a command when a file name is entered

edit: completion is quite important to me. Therefore if the beginning of a filename is typed then it would be nice if the rest of the filename would be completed when the TAB key is pressed.

share|improve this question
3  
This Q was crossposted: stackoverflow.com/questions/9058190/suffix-aliases-in-bash – fossfreedom May 23 '12 at 19:34
Closed as it was answered on Stack Overflow – Marco Ceppi May 23 '12 at 19:54
@MarcoCeppi It's not entirely answered yet, the completion bit is missing. Thanks for unclosing. – brillout.com May 23 '12 at 20:03
@brillout.com - I would suggest you pursue this further on SO - it has a good answer. If you are looking for completion, then you may wish to keep editing your Q there to bump it up the activity list. You may also wish to raise a small bounty on your Q to give it more prominence. Thanks. – fossfreedom May 23 '12 at 20:09

closed as too localized by Marco Ceppi May 23 '12 at 19:53

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.