Add an older tool I wrote ages ago.
This commit is contained in:
parent
eba7f75033
commit
81c7cefc9e
1
README
1
README
@ -11,3 +11,4 @@ msc - short script to auto-resize mandoc output
|
||||
modem-manager - used to manage laptop PCIe WAN modems. rather dense
|
||||
netsh - an old experiment that serves as a simple TUI for managing network interfaces... and an example of how not to use AWK
|
||||
plumber - one of my more sophisticated scripts; plumber creates pipes between programs based on what sort of input it receives, and handles errors (somewhat) intelligently
|
||||
bach - the Batch Audio Conversion Helper uses FFMPEG to convert large numbers of files at once
|
||||
|
23
bach
Executable file
23
bach
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if [ $# -le 1 ]
|
||||
then
|
||||
printf "This script will take two variables and convert all audio files of the first format to the second, using ffmpeg. \n"
|
||||
elif [ $# -ge 3 ]
|
||||
then
|
||||
printf "You've entered too many variables. We only need two... did you not check the help? \n"
|
||||
else
|
||||
i=`ls | grep $1 | wc -l`
|
||||
p=1
|
||||
|
||||
mkdir $2
|
||||
|
||||
while [ $p -le $i ]
|
||||
do
|
||||
x=`ls | sed "$p!d"`
|
||||
y=`printf "$x" | sed "s/$1/$2/"`
|
||||
yes | ffmpeg -i "$x" "$y"
|
||||
mv "$y" $2/
|
||||
p=$(( $p + 1 ))
|
||||
done
|
||||
fi
|
Loading…
Reference in New Issue
Block a user