HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: kaibab on 2005-04-13 15:51:58

Title: trying to convert batch files to shell scripts
Post by: kaibab on 2005-04-13 15:51:58
here is what i am trying to do
convert wavs to mp3s
i just need some help in converting dos batch files to linux shell scripts
here is a link to give you more info
http://www.linuxforums.org/forum/topic-39733.html (http://www.linuxforums.org/forum/topic-39733.html)
Title: trying to convert batch files to shell scripts
Post by: Garf on 2005-04-13 15:57:26
The problem is probably that you need to mark the scripts as executable on linux.

For example

chmod u+x myscriptname.sh
Title: trying to convert batch files to shell scripts
Post by: kaibab on 2005-04-13 15:59:46
i am kinda new to doing shell scripting
Title: trying to convert batch files to shell scripts
Post by: Benjamin Lebsanft on 2005-04-13 16:59:22
OT:
may I ask why you use -b 192 and -B 320 when using -V4 ? -mj is also the default. Seems odd.

If you use bash, you need something like:

Code: [Select]
list=`ls ~/path-to-your-waves`

for files in $list
do
 if [[ -f $files && ${files: -3} == "wav" ]]; then
     lame -V4 $files
 fi
done
Title: trying to convert batch files to shell scripts
Post by: xmixahlx on 2005-04-13 18:02:02
just write a for/do script to encode.

Code: [Select]
#!/bin/sh
for file in *wav
do
lame --alt-preset standard "$file"
done


Code: [Select]
#!/bin/sh
for dir in *
do
cd "$dir"
~/bin/myfuzzylamescript.sh
cd ..
done
Title: trying to convert batch files to shell scripts
Post by: kaibab on 2005-04-14 21:45:45
i have tried the scripts in the way that my batch files were written: bash -x scriptname.sh
it said it couldn't find the files
how do split the commands so you can use only one shell script file?
do i need to add #!/bin/bash before each lame command?
Title: trying to convert batch files to shell scripts
Post by: kaibab on 2005-04-14 21:46:58
i have tried the scripts in the way that my batch files were written: bash -x scriptname.sh
it said it couldn't find the files
how do split the commands so you can use only one shell script file?
do i need to add #!/bin/bash before each lame command?
Title: trying to convert batch files to shell scripts
Post by: kaibab on 2005-04-14 21:47:40
i have tried the scripts in the way that my batch files were written: bash -x scriptname.sh
it said it couldn't find the files
how do split the commands so you can use only one shell script file?
do i need to add #!/bin/bash before each lame command?
Title: trying to convert batch files to shell scripts
Post by: kaibab on 2005-04-14 21:48:25
i have tried the scripts in the way that my batch files were written: bash -x scriptname.sh
it said it couldn't find the files
how do split the commands so you can use only one shell script file?
do i need to add #!/bin/bash before each lame command?
Title: trying to convert batch files to shell scripts
Post by: xmixahlx on 2005-04-15 00:12:55
whoa there... settle down

try $ sh scriptname.sh
Title: trying to convert batch files to shell scripts
Post by: kaibab on 2005-04-15 01:56:23
Quote
whoa there... settle down

sorry about the triple posting
the stupid browser wouldn't load the next page this morning
the connection showed that it wasn't loading anything