* Carlos E. R. <robin.listas@telefonica.net> [03-09-19 13:48]:
On 09/03/2019 16.29, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [03-09-19 09:54]:
Hi,
I have a scripting problem.
I want to create relative paths. Googling told me I need to use:
realpath --relative-to=something someotherthing
But I can't find the correct concoction.
I have the following structure (TV recordings):
/home/cer/FusionTst/Videos/3_MyBook_Videos/Lore.mpeg /home/cer/FusionTst/Videos/3_MyBook_Videos/Big Bang/notes /home/cer/FusionTst/Videos/3_MyBook_Videos/Big Bang/Season 6/06x01.mpeg
From that list of absolute paths, I want to produce a relative one:
3_MyBook_Videos/Lore.mpeg or ./3_MyBook_Videos/Lore.mpeg ../3_MyBook_Videos/Big Bang/notes ../../3_MyBook_Videos//Big Bang/Season 6/06x01.mpeg
I got a headache, but no working solution.
Example:
cer@Isengard:~/FusionTst/Videos> realpath --relative-to="/home/cer/FusionTst/Videos/" "/home/cer/FusionTst/Videos/3_MyBook_Videos/Lore.mpeg" ../../../../data/My_Book/Fusion/Videos/Lore.mpeg cer@Isengard:~/FusionTst/Videos>
cer@Isengard:~/FusionTst/Videos> realpath --relative-to="/home/cer/FusionTst/Videos/3_MyBook_Videos/Lore.mpeg" "/home/cer/FusionTst/Videos/" ../../../../../home/cer/FusionTst/Videos cer@Isengard:~/FusionTst/Videos>
Previous to that I was using a method of my own that worked on some, failed on others. Then I stumbled into this "realpath" command, but I can not make it work as I need.
from what I see, "realpath" on the command-line merely prints the actual path from where the command is issued. ie: it does not construct a path similar to ln
No...
Back to googling.
-- Cheers / Saludos,
Carlos E. R. (from 15.0 x86_64 at Telcontar)
have you made it work previously? -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Registered Linux User #207535 @ http://linuxcounter.net Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org