how do i use bash to perform an operation on multiple files
I'm quite new to this and wonder if anyone can help me, i'm trying to have sox convert all the *.wav files in a specific directory into *.cdr files and keep the names so that i can write them to an audio cd. i have been trying
[brynn@brynn untitled folder]$ for i in *.wav; do sox "$i" 'basename "$i"'; done only i need the basename bit to omit the original extension and replace it with .cdr this seems to work in converting the mp3's to wav's which i got off a wiki but i cant seem to get it to work with sox [brynn@brynn untitled folder]$ for i in *.mp3; do mpg321 -w "`basename "$i" .mp3`.wav" "$i"; done any help will be greatly appreciated :) |
Try:
Code:
for i in *.wav ; do sox "$i" "`basename "$i" .wav`.cdr" ; done |
What about:
Code:
$ for i in *.wav; do sox "${i}" "`basename "${i}" .wav`.cdr"; done |
I believe (though could be wrong) that cdrecord, et. al, needs cdr format as opposed to wav files. Tools like K3B do this conversion for you, but it is still required.
|
Quote:
Quote:
|
you might find this old program of mine. it's used to burn multiple mp3 files without using cache on the hd. this is old and i'm kinda lazy now to recall the meaning of the code. anyway i'll send some improvements later if you find the script useful.
Code:
#!/bin/bash regards :) |
Cheers guys i've got it all going now thanks
|
All times are GMT -5. The time now is 11:24 AM. |