Joining two or more avi files is easy with mencoder.
Here is a simple script that I use to do it:
the cat command combines 1 and 2 into 3, but the audio isn't in sync. So, 3 is indexed with mencoder into 4 which has nicely synced audio.
# MjAVI - 2007
#Mencoder needs to be installed for this script to work
#The Numbers in this script could be changed to combine more than two files.
# Mencoder also supports mpeg files. So the .avi could also be changed to .mpg
echo "Script to combine two avi files, while syncing audio."
echo "usage: ./mjavi a1.avi a2.avi combined_temp.avi final.avi"
cat "$1" "$2" > "$3";
mencoder -forceidx -oac copy -ovc copy "$3" -o "$4"