command line – Open.webloc file with colons in its name utilizing “open”

Expect I have a file ~/ Desktop/foo: bar.webloc

( a) If I double-click it, it opens a specific websites. Fantastic!

( b) If in the Terminal I run open ~/ Desktop/foo: bar.webloc, it opens the web page. Fantastic!

( c) If in the Terminal I run cd Desktop and after that open foo: bar.webloc, I am welcomed with

% open foo: bar.webloc.
foo: bar.webloc?
[0] cancel.
[1] Open the file foo: bar.webloc.
[2] Open the URL foo: bar.webloc.

Which did you indicate?

I’m thinking that open believes that the filename may be a URL. Exists some method to require open to open the file by default if the file exists, even if the file name matches a pattern that could possibly be a URL? Type of the reverse of open -u? Do I simply require to prevent colons in filenames?

This occurred since Firefox developed a filename consisting of a colon when I dragged from the URL bar to the desktop, and after that I attempted to open it from the Terminal. Perhaps another concern is: exists a method to immediately get colon-free filenames when developing webloc files? (If you wish to check, you can utilize the URL https://github.com/sagemath/trac-to-github/blob/master/docs/Migration-Trac-to-Github.md Safari and Chrome produce colon-free filenames, however not Firefox.)

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: