Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   hyperlink other elog posts, posted by Remington Tyler Thornton on Tue May 28 19:01:42 2013 
    icon2.gif   Re: hyperlink other elog posts, posted by Andreas Luedeke on Wed May 29 14:57:23 2013 regreplace
Message ID: 67516     Entry time: Wed May 29 14:57:23 2013     In reply to: 67514
Icon: Reply  Author: Andreas Luedeke  Author Email: andreas.luedeke@psi.ch 
Category: Info  OS: Linux  ELOG Version: 2.8-2350 
Subject: Re: hyperlink other elog posts 

Remington Tyler Thornton wrote:

I am on an experiment that used ELOG for all documentation and meeting notes. In our meeting notes we link to elog posts that had been discussed during the meeting. We had done this by hyperlinking the URL to the entry. Recently we had to move our logbook to another machine and so none of our hyperlinks work since the URLs have changed. I noticed that when one creates a new entry in the subject they can reference another post. Is there a way to link another elog in the body of the elog by using its logbook name and id number without having to use a URL?

Thanks in advance

This is one of the rare cases where it helps to read the manual: https://midas.psi.ch/elog/userguide.html#add (You may need to upgrade to elog 2.9)

If you want to replace the old URLs with the new ones, you can edit the logbook files with the entries. The attached script allows you to do so easily. But be careful, try it on a copy of your data first.

 
Detect language » English
 
 
Detect language » English
 
Using:
regreplace "<old-url>" "<new-url>" *a.log
 
I hope this helps.
Andreas
Attachment 1: regreplace  687 Bytes  | Hide | Hide all
#!/bin/bash
if [ $# -lt 3 ]
then
	echo "using: $0 <search-for> <replace-with> <file-list>"
	exit
fi
if [ "$1" = "-f" ]
then 
	flag="-f"
	shift 1
else
	flag="-i"
fi
search="$(echo "$1"|awk '{gsub("\\","\\\\");gsub("/","\\/");print $0}')"
replace="$(echo "$2"|awk '{gsub("\\","\\\\");gsub("[$]","\\$");gsub("/","\\/");print $0}')"
shift 2
echo "replace \"$search\" with \"$replace\" in the files "
bold=`tput smso`
offbold=`tput rmso`
for file in $(grep -l "$search" "$@")
do
	tmp=/tmp/regreplace_$(basename $file)
	sed "s/${search}/${replace}/g" $file >$tmp
	
	echo "${bold}diffs of $file$offbold ('<' = before, '>' = after)"
	diff $file $tmp
	cp $flag $tmp $file
        rm -f $tmp
done
ELOG V3.1.5-3fb85fa6