🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #17914

Re: Automatic Signature in TRN?

#17914
From: Ollivier Robert
Date: Sun, 21 Jan 1996 00:00
94 lines
3576 bytes
[[ cc'ed to Mark ]]

In article <4dprbs$t5q@saltmine.radix.net>, Mark McLeod <mam@Radix.Net> wrote:
>    If someone has found a method that includes the signature in the
> ".article" or ".letter" before invoking the editor, please share your
> secret.  I suspect that many users of this fine software will
> appreciate your insights.

If you look at Pnews,  the script called by  Trn when one posts, you'll see
that:

1. if you have a .signature (like in mail) it will incorporate it,

2. you have a better way to do it:

use .news_sig for  you news signature  and .mail_sig for you mail signature
(if it is  different). You should configure  your mail software not to  use
.signature but .mail_sig (that's what I do with Elm). 

I also have a  patch to Pnews.SH to  use the ~/News/  hierarchy in order to
have different signatures depending on the groups... 

So you can   have news/signature and   news/software/readers/signature. The
global .news_sig is used if no signature file is found. 

Beware that  if  you   use .news.sig/.mail_sig,  you    must *not*  have  a
.signature of you'll have the signature twice...

--- Pnews.SH.DIST	Thu Apr 27 11:06:36 1995
+++ Pnews.SH	Tue Oct 31 21:20:57 1995
@@ -130,4 +130,28 @@
 tweak="$tmp/Pntwk.$$"
 
+# roberto - 4/7/95
+#
+# check all component of the group's tree beginning at last component
+# replaced by Thomas.Parmelan@darshiva.efrei.fr's own which does a better
+# job at bound checking.
+#
+check_tree() {
+    ng_tree=$1
+    path_list=`$echo $ng_tree | $sed 's,\.,/,g'`
+    while $test "x$path_list" != "x"; do
+        if $test -r $base_dir/$path_list/signature; then
+            local_sig="$base_dir/$path_list/signature"
+            return 0
+        fi
+        new_path_list=`$echo $path_list | $sed 's,/[^/]*$,,'`
+        if $test "$new_path_list" = "$path_list"; then
+            path_list=""
+        else
+            path_list=$new_path_list
+        fi
+    done
+    local_sig=""
+}
+
 case "$NETSPEED" in
 [0-4]) ;;
@@ -397,5 +421,21 @@
 $echo ""
 
-if $test -r $news_sig; then
+# roberto - 4/7/95
+#
+# Try to look in "path1/..path(n)/signature" first
+# then "path1/../path(n-1)/signature" till ~/News/signature
+#
+first_ng=`$echo $hdr_newsgroups | $sed 's,\([^ ]*\) .*,\1,'`
+base_dir="$dotdir/News"
+
+$echo First group is $first_ng
+local_sig=""
+check_tree $first_ng
+if $test ! x$local_sig = x ; then
+    echo Will use $local_sig for $first_ng
+    $echo "-- " >> $tmpart
+    $sed 4q $local_sig >> $tmpart
+elif $test -r $news_sig; then
+    $echo Will use standard signature in $news_sig
     $echo "-- " >> $tmpart
     $sed 4q $news_sig >> $tmpart
@@ -591,4 +631,5 @@
     esac
 done
+
 !NO!SUBS!
 $eunicefix Pnews

-- 
Ollivier ROBERT  -=- FreeBSD: The daemon is FREE! -=-  roberto@freebsd.org
-=-=-=-=-=-=-=-=-=-=- FreeBSD 2.x FAQ maintainer -=-=-=-=-=-=-=-=-=-=-=-=-

Technical Details
Message-ID: <4du9d6$4ek@keltia.freenix.fr>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <4dprbs$t5q@saltmine.radix.net>

Show Full Headers
Complete Article Headers
Message-ID: <4du9d6$4ek@keltia.freenix.fr>
Subject: Re: Automatic Signature in TRN?
Date: Sun, 21 Jan 1996 00:00:00 +0000
From: roberto@keltia.freenix.fr (Ollivier Robert)
References: <4dprbs$t5q@saltmine.radix.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 136254764
Content-type: text/plain; charset=ISO-8859-1
Organization: Usenet Canal Historique
Mime-version: 1.0
Newsgroups: news.software.readers