On Fri, 23 Nov 2007, Graeme Geldenhuys wrote:
> Hi, > > I'm trying to create a script to auto generate the fpdoc description > (*.xml) files, but I have no idea how the regex stuff works! Could > somebody help me please? > > This is what I have so far... in a myscript.sh file under Linux. > > The first 'sed' expression was copied from a google search, but I > think it was for .NET or something and doesn't work here. :-( As you > can guess I know nothing of regex. I just looks like lots of cursing > to me! ;-) > I'm considering writing a Free Pascal console app to do this, it's a > lot damn easier than figuring out this regex stuff. > > > --------- Copy -------------------- > #!/bin/sh > > PackageName=OPF > XMLBaseDir=./xml > PasSrcDir=../Sources/OPF > > ## create the output directory > mkdir -p $XMLBaseDir/$PackageName > > # process *.pas files and create makeskel line > for f in `find $PasSrcDir/ -type f -name *.pas`; do > > ShortFile=`echo $f | sed -e 's/\/([^/]+)$#//g' -e 's/\.pas\b//g'` > echo $ShortFile Why not simply use ShortFile = `basename $f .pas` ? Michael. _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives