Score:0

How to output properly linked file-URLs in Terminal Window?

in flag

I have a script that returns certain file paths, it would be nice if also those containing spaces could be opened with „right-click→open link“:

enter image description here

$> echo file:///home/frank/someOtherFolder/
file:///home/frank/someOtherFolder/

→ works as expected (no spaces involbed)


$> echo file:///home/frank/some Folder/
file:///home/frank/some Folder/

underlined Link ends after "some" → broken link


$> echo file:///home/frank/some%20Folder/
file:///home/frank/some%20Folder/

full URL is linked, but “right-click→open link” leads to nothing.

I also tried various quotes around the whole thing or just the path, but no luck....


echo "file:///home/frank/some\\ Folder"
file:///home/frank/some\ Folder

Nice one, eh? But URL also stops after some\ :-(

terdon avatar
cn flag
Does it work if you just quote them? `echo '"file:///home/frank/some Folder"'`
vanadium avatar
cn flag
The %20 trick works for me (currently on Fedora, though).
Frank Nocke avatar
in flag
@vanadium Does it just hover+underline on full length (I got that, too) or does it successfully open the link (that fails with Caja, under Ubuntu-MATE)?
Frank Nocke avatar
in flag
@terdon: Nope. It sure is written there nicely (same as with `\ `), but no hoverable full link created.
terdon avatar
cn flag
Then I doubt it will be possible. Just one more reason why it is a very bad idea to have spaces in file or dir names :/
vanadium avatar
cn flag
I had the impression it worked previous time, but not now: the entry indeed is underlined but clicking does nothing. However, right-click - "Open Link" opens nautilus in that directory.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.