Re: Need help with scripting
good job... one question... should it be "$@" instead of $@? ie. what
if he had spaces in the filenames... you could add a
mv "$file" "`echo $file | tr " " "_"`"
to turn all spaces in the filename into underscores as the first line
of the loop to handle that. right before
base=`basename $file .mp3`
Shawn
--- Sean 'Shaleh' Perry <shalehperry@attbi.com> wrote:
> On Thursday 17 October 2002 12:48, Kenneth Macdonald Karlsen wrote:
> > Hi all.
> > Im sorting out my 2000+ mp3 files.
> > Some of them i want to convert to wav files of various reasons.
> > Its a rather boring job to do that manualy so i thought i would
> write a
> > script. Im VERY inexperienced in this so help is needed.
> > Ive got this far:
> >
> > ken@pingu:~/brenning/test$ cat skript
> > #!/bin/bash
> > clear
> > echo "type name of file that shall go from mp3 to wav"
> > echo "ending of file is mp3.wav not solved yet"
> > read filename
> > mkdir wavfiles
> > mpg321 --w $filename.wav $filename
> > #rm -rf $filename
> > mv $filename.wav wavfiles
> >
>
> #!/bin/sh
>
> if [! -d wavfiles ]; then
> mkdir wavfiles
> fi
>
> for file in $@; do
> base=`basename $file .mp3`
> mpg321 --w ${base}.wav $file
> mv ${base}.wav wavfiles
> done
>
> and you can call it:
>
> skript alice_in_chains*
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
>
=====
Shawn Lamson
Debian/GNU Linux Woody
Kernel 2.2.19pre17
XFree86 Version 4.1.0.1 / X Window System
Jesus Loves You!
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
Reply to: