#!/bin/bash # scotar - version 1.0 # Extracts files from a multi-volume tar created on SCO Xenix through SCO OSR5 # on Linux or other systems using Bash-2.x and GNU tar. # # usage: scotar [device] (defaults to /dev/fd0) # Brian K. White - linut@squonk.net #DEBUG=1 echo "This script extracts a SCO xenix/unix format multi-volume tar." echo -n "How many volumes? " read vt c=1 [ $1 ] && d=$1 || d=/dev/fd0 while true ; do echo -en "Insert volume $c and hit Enter...\a" ; read v[$c]=`tar xvf $d` [ $c -gt 1 ] && { [ -f ${v[$((c-1))]} ] && { mv ${v[$((c-1))]} ${v[$((c-1))]}.scotarb mv ${v[$((c-1))]}.scotara ${v[$((c-1))]} cat ${v[$((c-1))]}.scotarb >>${v[$((c-1))]} rm -f ${v[$((c-1))]}.scotarb } ; } [ $c -eq $vt ] && exit for f in ${v[$c]} ; do : ; done ; v[$c]=$f ; [ $DEBUG ] && echo "** $f **" mv ${v[$c]} ${v[$c]}.scotara c=$((c+1)) done