Results 1 to 3 of 3
Hi All,
I have a series of scripts I am using to turn CD's into FLAC files.
The first one gets the album name and track names from the internet ...
- 07-05-2006 #1Just Joined!
- Join Date
- Jul 2006
- Posts
- 1
Bash script - cd to unknown directory
Hi All,
I have a series of scripts I am using to turn CD's into FLAC files.
The first one gets the album name and track names from the internet and then rips the CD to WAV using cdparanoia.
I have another script that will convert the WAV files into flac files using my cluster.
The problem I have is that I need to 'cd' to the folder containing the WAV files but the name is different each time as it is based on the album name.
I have tried piping ls and cd etc but am getting nowhere!!!
What I would like is a script that does the following.
changes to (for exampe) /home/chris/flactemp/albumname
I can then run the encoding script and them move the folder in to a completed area.
Any help would be appreciated.
Regards,
Chris
- 07-06-2006 #2
Well, you could do something like this:
So basically, store the CD name in a variable, and just build the variable right into your cd command.Code:discname=$(some_code_to_get_disc_name) cd ~/my_cds/$discname
DISTRO=Arch
Registered Linux User #388732
- 07-06-2006 #3Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
You may find the dirname command useful. It will pull the leading path from a variable that contains the filename.


Reply With Quote