0

Usually, a double dash separates options from filenames, but xdg-open does not care:

❯ xdg-open -headlinesAfter.epub
xdg-open: unexpected option '-headlinesAfter.epub'
Try 'xdg-open --help' for more information.
❯ xdg-open -- -headlinesAfter.epub
xdg-open: unexpected option '--'
Try 'xdg-open --help' for more information.

Is there any other way?

1

2 Answers 2

1

You can open the file by adding ./:

xdg-open ./-headlinesAfter.epub
0

Note that xdg-open is a shell script, so you can fix it yourself. Put a fixed version of it in a file of the same name in a personal directory in your PATH. A fix might be to simply not test for -* options, since none are supported. To do so remove the lines:

      -*)
        exit_failure_syntax "unexpected option '$parm'"
        ;;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .