<link> not clickable from text document

Thomas Springer th.springer at gmx.net
Sun Jul 31 22:06:22 UTC 2005


On Sun, 31 Jul 2005 21:50:15 +0100
THUFIR HAWAT wrote:

> On 7/31/05, Thomas Springer <th.springer at gmx.net> wrote:
> ...
> > Try this:
> > 
> > $ sed 's|^http://\(.*/\)\(.*\)|<a href="\1\2">\1</a>|g; s|href="|
> > href="http://|g' /input/file/with/links > /output/file/with/
> > clicklinks
> > 
> > 
> > It's minimal changed from the first example, which didn't things
> > well when i tried it out with your uri.
> > 
> > 
> > Thomas
> ...
> 
> Sorry that I didn't notice that sed was using input and output files, 
> should've seen that.
> 
> I made a dummy with just one link to test the sed command.  The  link
> is entirely on one line, where as if I were to paste it here then it
> would wrap, I'm not sure if that's relevant.
> 
> Here's the link in dumm.txt, wrapped:
> 
> <http://ipac3.vpl.ca/ipac20/ipac.jsp?uri=full=3100001~!1150206~!25&ri=4&aspect=basic_search$>
> 
> 
> [thufir at arrakis click]$ date
> Sun Jul 31 21:26:23 IST 2005
> [thufir at arrakis click]$ pwd
> /home/thufir/click
> [thufir at arrakis click]$ ll
> total 36
> -rw-rw-r--  1 thufir thufir    0 Jul 31 21:26 clicklist.txt
> -rw-rw-r--  1 thufir thufir   95 Jul 31 21:26 dummy.txt
> -rw-rw-r--  1 thufir thufir 5366 Jul 31 08:37 linklist.txt
> -rw-rw-r--  1 thufir thufir 5366 Jul 31 15:38 linklist.txt.backup
> [thufir at arrakis click]$ cat dummy.txt
> http://ipac3.vpl.ca/ipac20/ipac.jsp?uri=full=3100001~!1150206~!25&ri=4&aspect=basic_search$
> 
> 
> [thufir at arrakis click]$ sed 's|^http://\(.*/\)\(.*\)|<a
> href="\1\2">\1</a>|g; s|href="|
> href="http://|g' dummy.txt > clicklist.txt
> sed: -e expression #1, char 58: unterminated `s' command
> [thufir at arrakis click]$
> 
> 
> 
> I opened "dummy.txt" from openoffice and the link wasn't clickable,
> but I do notice that if I were to e-mail these to myself that they
> become clickable from gmail.  Still, I'd like to get the sed command
> working, partly out of curiousity.
> 
> 
> Thanks,
> 
> Thufir
>

It goes like this,
 
$ sed 's|^http://\(.*/\)\(.*\)|<a href="\1\2">\1</a>|g;
> s|href="| href="http://|g' dummy.txt > clicklist.txt
$ echo $?
0
$ cat clicklist.txt
<a href="http://ipac3.vpl.ca/ipac20/ipac.js..">ipac3.vpl.ca/ipac20/</a>

Sorry,I can't see why it doesn't work for you.

Try again, or use the file which comes with this message.

* Save,
* make it executable, then
* ./clinks.sh inputfile > outputfile

Thomas




-------------- next part --------------
A non-text attachment was scrubbed...
Name: clinks.sh
Type: application/x-sh
Size: 100 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20050801/d3772431/attachment-0001.sh>


More information about the fedora-list mailing list