re bash script help

re bash script help

Post by Dr. Yuan Li » Sun, 13 Apr 2003 15:24:39

> Have tried both suggested scripts to convert
> wave files to mp3 .
> **********************
>  #!/bin/bash
>   for i in *.mp3; do
>     mpg321 --w - "$i"  > `basename $i .mp3`.wav
>   done

> script error "basename:  too many arguments"

> It would seem to be caused by long filenames with spaces
> enclosing the name in quotes is a cure but that would require
> a loop script too.

( would be more appropriate.) I don't quite see what's
wrong with `basename "$i" .mp3`.wav; what do you mean by require a loop
script?  You are already using a loop, do you mean to eliminate for

Yuan Liu

Quote:> ********************
> for I in *.mp3
> do
>         mpg321 --w - $I  >  ${I%.mp3}.wav
> done

> script error "ambiguous redirect"
> file lengh has no effect on this one

> ******************
> any suggested mods


1. bash script help

I have no bash script skills at all

I want to convert collection of mp3 files
to wave or cdr
Using a script ripped off from the cdwrite howto ( below )
the result is a wave file with two extensions "file.mp3.wav".
Obviously I want only ".wav".

The "correct" script would be appreciated.


for I in *.mp3


        mpg321 --w - "$I"  > "$I".wav



2. Contrab question.

3. moving disk drive

4. simple bash script help

5. Telnet script

6. Linux BASH Script HELP!!!!!

7. Recommendation on Fax software in Solaris 2.6

8. Passing option to bash script help needed

9. Simple bash script help?

10. re bash script help

11. Bash script help..

12. BASH script help