I have an sh script:
#!/bin/bash
fullpath="$1"
filename="${fullpath##*/}"
dir="${fullpath:0:${#fullpath} - ${#filename}}"
base="${filename%.[^.]*}"
ext="${filename:${#base} + 1}"
if [ -f $fullpath ]; then
if [ $ext != "mp4" ]; then
ffmpeg -threads 4 -i $fullpath -y -vcodec libx264 -g 100 -bt 100k mp4 -vpre fast -acodec libfaac -ab 128k "$dir$base.mp4"
mv -f "$dir$base.mp4" "/data/www/rfpl/htdocs/videotapes/$base.mp4"
fi
fi
So, I wrote it for Linux, now I need to run it under FreeBSD, but I don't know anything about FreeBSD. There is an error:
./convert.sh: ${fullpath:0...}: Bad substitution.
I think that there is no bash, how can I make it to work?