Mailinglist Archive: opensuse-support (183 mails)

< Previous Next >
Re: [opensuse-support] Re: Scripting problem
Carlos, et al --

...and then Carlos E. R. said...
%
% On 09/03/2019 16.22, Andrei Borzenkov wrote:
% > 09.03.2019 17:51, Carlos E. R. ??????????:
% >>
...
% >> 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
...
%
% cer@Isengard:~/FusionTst/Videos> tree 3_MyBook_VideosTst/
% 3_MyBook_VideosTst/
% ????????? Big Bang
% ???   ????????? notas
% ???   ????????? Season 1
% ???   ???   ????????? episode dos.mpeg
% ???   ???   ????????? episode tres.mpeg
% ???   ???   ????????? episode uno.mpeg
% ???   ????????? Season 2
% ???   ????????? episode dos.mpeg
% ???   ????????? episode tres.mpeg
% ???   ????????? episode uno.mpeg
% ????????? Big Poof
% ???   ????????? notas
% ???   ????????? Season 1
% ???   ???   ????????? episode dos.mpeg
% ???   ???   ????????? episode tres.mpeg
% ???   ???   ????????? episode uno.mpeg
% ???   ????????? Season 2
% ???   ????????? episode dos.mpeg
% ???   ????????? episode tres.mpeg
% ???   ????????? episode uno.mpeg
% ????????? notas
[snip]

I find myself wondering if you have reduced this to a trivial case. I
wasn't patient enough to follow your various realpath(1) examples, so
I've snipped them, but as you say the tool isn't important.

It seems to me that you could just use find(1) to list your files. But I
know you know that, so ... it must not be that simple :-)

If there's more than the tree above, please lay out a fuller structure.
Please also point out where you want to be (perhaps multiple places?) and
the result you want to see that you carefully construct manually so that
we can back into the engineering :-)

And, just because I'm curious, I wonder why you specifically want relative
paths rather than absolute paths, which certainly keep life simple...


HTH & HANW

:-D
--
David T-G
See http://justpickone.org/davidtg/email/
See http://justpickone.org/davidtg/tofu.txt

--
To unsubscribe, e-mail: opensuse-support+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-support+owner@xxxxxxxxxxxx

< Previous Next >