I have a function called groovy defined in my .bashrc.
I have this bash script where I want to use groovy.
It says ./batch.sh: line 7: groovy: command not found
Although I source .bashrc in the beginning of the script.
What am I missing ?
batch.sh
#!/usr/bin/env bash
source ~/.bashrc
for file in *.html;
do
name="${file%.html}"
groovy "$name.html" "uncached/$name.mp3"
done;
part of .bashrc
function groovy {
sed -n '/<pre>/,/<\/pre>/p' "$1" | replace '<pre>' '' '</pre>' '' | hextomp3 - "$2"
}
function hextomp3 {
echo "in $1"
echo "out $2"
echo "cut -c10-74 $1 | xxd -r -p - $2"
cut -c10-74 "$1" | xxd -r -p - "$2"
}
output :
chaouche@karabeela ~/DOWNLOADS/MUSIQUE $ ./batch.sh
./batch.sh: line 6: groovy: command not found
./batch.sh: line 6: groovy: command not found
./batch.sh: line 6: groovy: command not found
./batch.sh: line 6: groovy: command not found
./batch.sh: line 6: groovy: command not found
./batch.sh: line 6: groovy: command not found