Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Replacing substrings with links

by LanX (Saint)
on Feb 05, 2022 at 22:10 UTC ( [id://11141162]=note: print w/replies, xml ) Need Help??


in reply to Replacing substrings with links

> Each key is a path, which is the absolute path of the value. For example:

> realpath /p # Yields /a/b/c

> For each value, I would like to replace the substring with the other link, if such exists. In our case, we have "/a/b/c/dt/sde/tools/em64t_SUSE/tool/0.9.0" and "/a/b/c" => "/p" , so I would like to have:

You are aware that a file system can have multiple links pointing to the same "realpath", right?

And if you had multiple links qualifying like an additional "/a/b" => "/q" you'd probably want to replace "/a/b/c" first to have a shorter result.

This will become pretty messy without further clarification.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141162]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-16 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found