Hacker News new | ask | show | jobs
by userbinator 3942 days ago
You may be diappointed to know that Windows' cmd.exe will automatically open the default associated program, so all you need to do is enter the filename if you've associated image files with a default viewer:

http://superuser.com/questions/246825/open-file-from-the-com...

(I suppose a similar thing could be done on *nix with a suitably modified execlp()/execvp().)

2 comments

Freedesktop systems get you an 'xdg-open' command (there's also 'gnome-open' for GNOME, and 'open' for Mac OS X).

On Linux you should be able to wire up binfmt_misc, the plugin system for execve, to xdg-open.

kde-open exists, too ;)
If I understand you correctly you can also do this in zsh: https://grml.org/zsh/zsh-lovers.html although not automatically.