summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2010-09-14 15:08:39 +0100
committerNick White <git@njw.me.uk>2010-09-14 15:08:39 +0100
commit7a0c25eac0f1c2adf031343ff8c761ba73570cb6 (patch)
tree9d4ef0400ec0cf9bdedd021ac0d53c833a32ddb8
parent049137943c22098b208a8ef977afcf8d716d2796 (diff)
downloadnjw-website-7a0c25eac0f1c2adf031343ff8c761ba73570cb6.tar.bz2
njw-website-7a0c25eac0f1c2adf031343ff8c761ba73570cb6.zip
Use gnu sed syntax by default in bibtotxt
-rwxr-xr-xbibtotxt.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/bibtotxt.sh b/bibtotxt.sh
index e6de507..1c53ce4 100755
--- a/bibtotxt.sh
+++ b/bibtotxt.sh
@@ -3,7 +3,7 @@
rdf="$1"
echo "Publications"
-echo "======================================================================="
+echo "-----------------------------------------------------------------------"
echo ""
q="PREFIX dc: <http://purl.org/dc/elements/1.1/>
@@ -23,11 +23,12 @@ WHERE {
roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \
| while read r; do
- uri=`echo $r | awk -F , '{print $2}'| sed -e 's/^uri\(//' -e 's/\)$//'`
+ # note that plan9 sed needs the ( in uri( etc escaped with \(
+ uri=`echo $r | awk -F , '{print $2}'| sed -e 's/^uri(//' -e 's/)$//'`
reluri=`echo $uri | sed 's/.*\///'`
title=`echo $r | awk -F , '{print $3}'| sed -e 's/^"//' -e 's/"$//'`
artdate=`echo $r | awk -F , '{print $4}'| sed -e 's/^"//' -e 's/"$//'`
- stat=`echo $r | awk -F , '{print $5}'| sed -e 's/^uri\(//' -e 's/^[^\/]*\///' -e 's/\)$//'`
+ stat=`echo $r | awk -F , '{print $5}'| sed -e 's/^uri(//' -e 's/^[^\/]*\///' -e 's/)$//'`
jtitle=`echo $r | awk -F , '{print $6}'| sed -e 's/^"//' -e 's/"$//'`
juri=`echo $r | awk -F , '{print $7}'| sed -e 's/^"//' -e 's/"$//'`
vol=`echo $r | awk -F , '{print $8}'| sed -e 's/^"//' -e 's/"$//'`