[pmwiki-users] PmWiki/PageFileFormat
pmwiki at 911networks.com
pmwiki at 911networks.com
Tue Jun 29 11:40:47 CDT 2010
Hi,
I'm trying to extract text from a whole bunch of pages:
I'm trying to run from PmWiki/PageFileFormat
#!/bin/tcsh
# wtext - extract wiki text
#
# wtext wikifile > output
set fn = "$1"
if ("$fn" == "") then
echo "need input file parameter"
exit 999
endif
if (! -f $fn) then
echo "$fn does not exist"
exit 999
endif
rm sedin.$$ >& /dev/null
set ch = `grep ^newline= $fn | cut -d= -f2`
if ("$ch" == "") set ch = "%0a"
cat <<eof > sedin.$$
s/^text=//
s/$ch/\
/g
s/%3c/</g
s/%25/%/g
eof
grep "^text=" "$1" | sed -f sedin.$$
rm sedin.$$ >& /dev/null
Doesn't work on Linux: CentOS 4. I get the following error message:
Line 17: syntax error near unexpected token `set'
Line 17: `if ("$ch" == "") set ch = "%0a"'
Any suggestion on how to fix it?
Thanks
--
Thanks
http://www.911networks.com
When the network has to work
More information about the pmwiki-users
mailing list