Article 4QNR1 Append directory path to FNs over entire directory structure

Append directory path to FNs over entire directory structure

by
ericlindellnyc
from LinuxQuestions.org on (#4QNR1)
I would like each file on my drive to have self-contained information about its proper location, in case it is moved.

Only the 5 deepest subdirectories are needed.

So,
/Volumes/Drive1/ ... /AA/BB/CC/DD/EE/FF/sample.txt
would become
BBCCDDEEFFsample.txt

& located in same directory as original file, i.e.
/Volumes/Drive1/ ... /AA/BB/CC/DD/EE/FF/BBCCDDEEFFsample.txt.

I have googled around to find how to append PWD, but that only works if you're "in" each subdirectory as you traverse.

Help much appreciated.latest?d=yIl2AUoC8zA latest?i=0ytDwLDHyvw:jsnE5AaZQhM:F7zBnMy latest?i=0ytDwLDHyvw:jsnE5AaZQhM:V_sGLiP latest?d=qj6IDK7rITs latest?i=0ytDwLDHyvw:jsnE5AaZQhM:gIN9vFw0ytDwLDHyvw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments