Linux command line - grabbing parts of the file path

view story

http://stackoverflow.com – I'm in the process of attempting to convert all my WAV files to FLAC files in such a way that my music directory for FLACs is identical to my music directory for WAVs. At the moment I have my music archive set up, such that a typical album is here: /directory1/directory2/directory3/Music/WAV/Artist/Album So I would like a one-to-one correspondance for my FLAC files that looks as follows: /directory1/directory2/directory3/Music/FLAC/Artist/Album. I know that I will have to use find to list all the directories/subdirectories as follows: find -type d -exec commands.sh But how do I write th (HowTos)