Finding the preferred application for a given file extension via unix shell commands

前端 未结 3 764
再見小時候
再見小時候 2021-01-15 14:43

this may not be strictly about programming, but if I find no ready-made solution it may become a programming task: On UNIX, what is a command-line method f

3条回答
  •  太阳男子
    2021-01-15 15:06

    To answer this myself, I've defined a simple (bash) function that works in the way I expect:

    function show { 
        xdg-open $1 &> NUL
        }
    

    xdg-open was almost exactly what I wanted, but it lets ugly program warnings slip through into the shell, which the above seems to fix.

    Thanks all.

提交回复
热议问题