Thread View: news.software.readers
5 messages
5 total messages
Started by Toby Fisher
Wed, 18 Nov 1998 00:00
SLRN, can hooks be useed?
Author: Toby Fisher
Date: Wed, 18 Nov 1998 00:00
Date: Wed, 18 Nov 1998 00:00
15 lines
1135 bytes
1135 bytes
Does anybody know whether it is possible to force SLRN to run another another program to generate signatures, Fortune, for example? Btw, I'm currently using v0.9.5.2. -- Toby Fisher Email: toby@cottingham.u-net.com On the web: http://www.cottingham.u-net.com tel.: 0411 604309 . "INtel make faster processors, Microsoft make slower processes." Geoff Blake.
Re: SLRN, can hooks be useed?
Author: John E. Davis
Date: Wed, 18 Nov 1998 00:00
Date: Wed, 18 Nov 1998 00:00
114 lines
3221 bytes
3221 bytes
On 18 Nov 98 17:12:38 GMT, Peppe <c928400@student.dtu.dk>
wrote:
> set signature .signature
> set editor_command "getsig>~/.signature; vim -c ':0;/^$/+' '%s'"
I think that the most elegant solution is to make .signature a named
pipe. Then create a signature process, e.g., a modification of
getsig, that waits for something to open .signature, at which point
the process would write something to the pipe and then close it. For
example, consider the following `silly' program (silly.c follows below).
(Note also that this will not work across NFS, which does not
implement named pipes).
# ls -l /tmp/XXXX
/bin/ls: /tmp/XXXX: No such file or directory
# gcc silly.c -o silly
# ./silly /tmp/XXXX &
[2] 5864
# ls -l /tmp/XXXX
prw-r--r-- 1 davis asc 0 Nov 18 13:51 /tmp/XXXX|
# cat /tmp/XXXX
Signature 1
# cat /tmp/XXXX
Signature 2
# cat /tmp/XXXX
Signature 3
# cat /tmp/XXXX
Signature 4
# cat /tmp/XXXX
Signature 5
# cat /tmp/XXXX
Signature 1
# cat /tmp/XXXX
Signature 2
# cat /tmp/XXXX
Signature 3
# cat /tmp/XXXX
Signature 4
# cat /tmp/XXXX
Signature 5
I think you get the idea. Here is silly.c. I do not know why `sleep'
is required. Perhaps someone will tell me.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
static int write_signature (char *file, char *sig)
{
FILE *fp;
if (NULL == (fp = fopen (file, "w")))
{
fprintf (stderr, "Unable to open %s\n", file);
return -1;
}
(void) fputs (sig, fp);
(void) fclose (fp);
sleep (2);
return 0;
}
static char *Silly_Signatures[] =
{
"Signature 1\n",
"Signature 2\n",
"Signature 3\n",
"Signature 4\n",
"Signature 5\n",
NULL
};
int main (int argc, char **argv)
{
char *file;
char **sig;
if (argc != 2)
{
fprintf (stderr, "Usage: %s SIGNATURE-NAMED-PIPE\n", argv[0]);
return 1;
}
file = argv[1];
(void) remove (file);
if (-1 == mkfifo (file, 0666))
{
fprintf (stderr, "Unable to create %s\n", file);
return 1;
}
while (1)
{
sig = Silly_Signatures;
while (*sig != NULL)
{
if (-1 == write_signature (file, *sig))
return 1;
sig++;
}
}
}
Re: SLRN, can hooks be useed?
Author: Peppe
Date: Wed, 18 Nov 1998 00:00
Date: Wed, 18 Nov 1998 00:00
18 lines
1457 bytes
1457 bytes
Thus wrote Toby Fisher <toby@cottingham.u-net.com>
> Does anybody know whether it is possible to force SLRN to run another
> another program to generate signatures, Fortune, for example?
I use the following for my editor: First select a new signature (for
which I have my own script), then call the editor.
set signature .signature
set editor_command "getsig>~/.signature; vim -c ':0;/^$/+' '%s'"
Peppe
--
Preben Guldberg __/-\__ "Linux poses a real challenge for
c928400@student.dtu.dk (o o) those with a taste for late-night
----------------------oOOo (_) oOOo hacking (and/or conversations
http://www.student.dtu.dk/~c928400/ with God)." --Matt Welsh
Re: SLRN, can hooks be useed?
Author: Gerfried Fuchs
Date: Fri, 20 Nov 1998 00:00
Date: Fri, 20 Nov 1998 00:00
44 lines
2680 bytes
2680 bytes
On 18 Nov 1998, John E. Davis <davis@space.mit.edu> wrote: > > I think that the most elegant solution is to make .signature a named > pipe. Then create a signature process, e.g., a modification of > getsig, that waits for something to open .signature, at which point > the process would write something to the pipe and then close it. For > example, consider the following `silly' program (silly.c follows below). > (Note also that this will not work across NFS, which does not > implement named pipes). ---- snip ---- It's funny that you said that :) I am currently working on such a program. It works quite fine for me already and I planed to announce it quite soon - but now you came along and I have to hurry a bit ;) Have a look at http://alfie.ml.org/agp/sigd/ which is exactly that what you wrote about here - besides it takes all files out of a special directory and put's them randomly (just like fortune - what was originally asked for) into that pipe. It is not very well documented yet - I'm working on that. And it will get the features stated on the page; and more, if you ask for ;) It's quite stable - although it's no 'real' daemon yet, just a called program - which exits when you end the shell that it's started from :( But if you put the following 2 lines in your .login or .bash_login file, everything should be quite fine: killall sigd exec sigd & For sure you have to put sigd in a directory included in $PATH for that working :) Just look in the sigd.c file for some changes (maybe you want to host your signatures in another directory), notice that files with a . at their start will be ignored! And I don't know what it does with 'special' files in that directory - just avoid them. Then type make and copy the resulting sigd file e.g. in your ~/bin directory (or even in /usr/local/bin - I would be pleased ;). I hope, this pleases you :) Alfie aka Gerfried Fuchs -- The best defense against logic is ignorance.
sigd - URL change!
Author: Gerfried Fuchs
Date: Fri, 20 Nov 1998 00:00
Date: Fri, 20 Nov 1998 00:00
56 lines
3175 bytes
3175 bytes
Hello again. Due to technical problems the VirtualHost alfie.ml.org had to be turned off for the moment, please use the following URL instead: http://skater.htu.tuwien.ac.at/~alfie/agp/sigd/ Sorry for the inconvenience! Gerfried Fuchs aka Alfie -- Gravity is a myth, the Earth sucks. On 20 Nov 1998 12:49:50 GMT, Gerfried Fuchs <alfie@innocent.com> wrote: > On 18 Nov 1998, John E. Davis <davis@space.mit.edu> wrote: > > > > I think that the most elegant solution is to make .signature a named > > pipe. Then create a signature process, e.g., a modification of > > getsig, that waits for something to open .signature, at which point > > the process would write something to the pipe and then close it. For > > example, consider the following `silly' program (silly.c follows below). > > (Note also that this will not work across NFS, which does not > > implement named pipes). > ---- snip ---- > > It's funny that you said that :) I am currently working on such a program. > It works quite fine for me already and I planed to announce it quite soon - but > now you came along and I have to hurry a bit ;) > Have a look at http://alfie.ml.org/agp/sigd/ which is exactly that what you > wrote about here - besides it takes all files out of a special directory and > put's them randomly (just like fortune - what was originally asked for) into > that pipe. > It is not very well documented yet - I'm working on that. And it will get the > features stated on the page; and more, if you ask for ;) > > It's quite stable - although it's no 'real' daemon yet, just a called program > - which exits when you end the shell that it's started from :( But if you put > the following 2 lines in your .login or .bash_login file, everything should be > quite fine: > killall sigd > exec sigd & > For sure you have to put sigd in a directory included in $PATH for that > working :) > > Just look in the sigd.c file for some changes (maybe you want to host your > signatures in another directory), notice that files with a . at their start > will be ignored! And I don't know what it does with 'special' files in that > directory - just avoid them. > Then type make and copy the resulting sigd file e.g. in your ~/bin directory > (or even in /usr/local/bin - I would be pleased ;). > > I hope, this pleases you :) > > Alfie aka Gerfried Fuchs > -- > The best defense against logic is ignorance.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads