After reading this answer about a zsh feature:If a given extension has a suffix  alias, you can execute a file with  that extention directly, and ZSH will  launch the given program and pass the  filename as an argument.Is there something similar to bash? That is, if a given file has an extension, how to directly execute that file, automatically launching a program just by calling the file's name? So doingprogram /path/to/foo.ext/path/to/foo.extwould equivalent to the same zsh feature? Is this feature available in newer versions of bash?
Execute a file in an application based on the file's extension in bash
bash
While I am not familiar with every feature of Bash, I do not believe this is a built-in feature of the Bash shell.  I was unable to find this feature in the relevant sections of the Bash manual.You may be able to cobble something together using trap.  From help trap:Trap signals and other events.Defines and activates handlers to be run when the shell receives signals  or other conditions.Thus by using the command:$ trap my_function ERRI can ensure that my_function is called whenever a command fails.  my_function could be a function that parses the previous command, looking for known extensions and calling the appropriate command based on that extension.Depending on your interest, writing such a function may be more or less interesting than moving to the z shell.