OK, so just add the extglob option:
#!/bin/sh
# Linux-Mandrake ISO CD Creation Script (thanks to Kenny Graunke for this one!)
# You MUST change these variables for your particular configuration:
shopt -s extglob
# Set this to the location of where you want to download Linux-Mandrake to.
mdkLOCALROOT=/mnt/disk
# Set these to the location where you want your ISO images to be created.
mdkISO1DIR=/output/directory
mdkISO2DIR=/output/directory
# Set this to 1 to download Linux-Mandrake.
mdkMIRROR=0
# Set these to your FTP mirror and directory, respectively:
mdkFTPSITE=ftp.somewhere.org
mdkFTPDIR=/some/dir/hydrogen
# You should not have to change anything below this point.
#mirror from ftp preserving permissions and symlinks
cd $mdkLOCALROOT/mirror
[ "$mdkMIRROR" = "1" ] && lftp -c "open $mdkFTPSITE\; cd $mdkFTPDIR\; mirror"
# create new directories to separate the rpms for the two cds
mkdir -p $mdkLOCALROOT/tmp
mkdir -p $mdkLOCALROOT/cd2
mkdir -p $mdkLOCALROOT/cd2/Mandrake/RPMS2
# move all files in the directory for CD2
mv $mdkLOCALROOT/mirror/Mandrake/RPMS/* $mdkLOCALROOT/cd2/Mandrake/RPMS2/
mv $mdkLOCALROOT/mirror $mdkLOCALROOT/cd1
# move the apropriate files in the directory for first CD
for i in `cat $mdkLOCALROOT/cd1/Mandrake/base/rpmslist`
do
mv $mdkLOCALROOT/cd2/Mandrake/RPMS2/$i-!(*-*)-!(*-*)mdk*.rpm
$mdkLOCALROOT/cd1/Mandrake/RPMS/
done
# generate the dependance files
rm -f $mdkLOCALROOT/cd1/Mandrake/base/{hdlists,hdlist.cz2}
genhdlist_cz2 -o $mdkLOCALROOT/cd1/Mandrake/base/hdlist.cz2
$mdkLOCALROOT/cd1/Mandrake/RPMS/
echo "hdlist.cz2 Mandrake/RPMS Installation CD" >
$mdkLOCALROOT/cd1/Mandrake/base/hdlists
rm -f $mdkLOCALROOT/cd1/Mandrake/base/hdlist2.cz2
genhdlist_cz2 -o $mdkLOCALROOT/cd1/Mandrake/base/hdlist2.cz2
$mdkLOCALROOT/cd2/Mandrake/RPMS2/
echo "hdlist2.cz2 Mandrake/RPMS2 Extension CD" >>
$mdkLOCALROOT/cd1/Mandrake/base/hdlists
rm -f $mdkLOCALROOT/cd1/Mandrake/base/{depslist,deplist.ordered,filelist}
gendepslist2 -o $mdkLOCALROOT/cd1/Mandrake/base/depslist
$mdkLOCALROOT/cd1/Mandrake/base/hdlist.cz2 $mdkLOCALROOT/cd1/Mandrake/base/hdlist2.cz2
genfilelist $mdkLOCALROOT/cd1/Mandrake/RPMS $mdkLOCALROOT/cd2/Mandrake/RPMS2 >
$mdkLOCALROOT/cd1/Mandrake/base/filelist
# Do a little prep to get the boot images to the start of the first disk
mv $mdkLOCALROOT/cd1/images $mdkLOCALROOT/tmp
# create the first iso image
mkisofs -R \
-o $mdkISO1DIR/hydrogen.iso \
-b images/cdrom.img \
-c images/.catalog \
$mdkLOCALROOT/tmp \
$mdkLOCALROOT/cd1
# move the images back where they belong
mv $mdkLOCALROOT/tmp/images $mdkLOCALROOT/cd1/
rmdir $mdkLOCALROOT/tmp
# create the second iso image
mkisofs -R \
-o $mdkISO2DIR/hydrogen_extentions.iso \
$mdkLOCALROOT/cd2
--
Warly