Skip to main content

Topic: trying to convert batch files to shell scripts (Read 4911 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • kaibab
  • [*]
trying to convert batch files to shell scripts
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
  • Last Edit: 13 April, 2005, 10:53:38 AM by kaibab

  • Garf
  • [*][*][*][*][*]
  • Developer (Donating)
trying to convert batch files to shell scripts
Reply #1
The problem is probably that you need to mark the scripts as executable on linux.

For example

chmod u+x myscriptname.sh
  • Last Edit: 13 April, 2005, 10:57:41 AM by Garf

  • kaibab
  • [*]
trying to convert batch files to shell scripts
Reply #2
i am kinda new to doing shell scripting
  • Last Edit: 13 April, 2005, 11:00:33 AM by kaibab

trying to convert batch files to shell scripts
Reply #3
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
  • Last Edit: 13 April, 2005, 12:02:47 PM by Benjamin Lebsanft

  • xmixahlx
  • [*][*][*][*][*]
trying to convert batch files to shell scripts
Reply #4
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

  • kaibab
  • [*]
trying to convert batch files to shell scripts
Reply #5
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?

  • kaibab
  • [*]
trying to convert batch files to shell scripts
Reply #6
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?

  • kaibab
  • [*]
trying to convert batch files to shell scripts
Reply #7
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?

  • kaibab
  • [*]
trying to convert batch files to shell scripts
Reply #8
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?

  • xmixahlx
  • [*][*][*][*][*]
trying to convert batch files to shell scripts
Reply #9
whoa there... settle down

try $ sh scriptname.sh

  • kaibab
  • [*]
trying to convert batch files to shell scripts
Reply #10
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
  • Last Edit: 14 April, 2005, 08:57:40 PM by kaibab