Again my sincere thanks fuorviato,
I incorporated tree into my directory reading script thus
Code:
df | grep /dev/sr0 | grep /media | awk '{print$ 6}' | sed s/"\/media\/"// >> dvd.list
mount -t iso9660 /dev/sr0 /dvd
tree /dvd >> dvd.list
echo >> dvd.list
umount /dvd
eject /dev/sr0
It produces nice results for example
Quote:
Video_1738
/dvd
|-- Female Comedy Teams
| |-- Disc 1
| | |-- 01 - Feed 'em and Weep (1928) (DVDRip) [Guild55].avi
| | |-- 02 - A Pair of Tights (1929) (DVDRip) [Guild55].avi
| | |-- 03 - Babes in the Goods (1934) (DVDRip) [Guild55].avi
| | |-- 04 - Maid in Hollywood (1934) (DVDRip) [Guild55].avi
| | |-- 05 - Show Business (1932) (DVDRip) [Guild55].avi
| | |-- 06 - Asleep in the Feet (1933) (DVDRip) [Guild55].avi
| | `-- 07 - Work in Progress - Restoration of Going Ga-ga (1929) DVDRip [Guild55].avi
| `-- Disc 2
| |-- 01 - The Bargain of the Century (1933) (DVDRip) [Guild55].avi
| |-- 02 - Beauty and the Bus (1933) (DVDRip) [Guild55].avi
| |-- 03 - The Pajama Party (1931) (DVDRip [Guild55].avi
| |-- 04 - On the Loose (1931) (DVDRip) [Guild55].avi
| |-- 05 - The Misses Stooge (1935) (DVDRip) [Guild55].avi
| `-- 06 - Top Flat (1935) (DVDRip) [Guild55].avi
`-- MalteseFalcon.mkv
3 directories, 14 files
|
I could do without the /dvd line and the 3 directories, 14 files line but I can live with that (or delete it manually before I paste the results of a batch of DVDs into the master catalog file.) Or I might get creative and figure out how to strip out those lines. I think head and tail might come into play but I will have to do a little reading first.
You have provided me with the answer to my original question and I will mark this thread as solved!
Thanks once more,
Ken
p.s. The way I use this script is as follows:
1 - insert a DVD
2 - allow the DVD to auto mount
3 - run the script (as root because of mount/umount)
4 - pick up the ejected DVD and repeat - all rather efficient
I think I can improve it by parsing the label of the DVD to a variable and substituting it into the tree command. That would eliminate the redundant mount and allow me to run the script as a normal user. That is on my todo list.