🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #259976

Re: [slrn] Modify signature based on newsgroup

#259976
From: Lewis
Date: Sat, 16 Jan 2016 13:45
47 lines
2539 bytes
In message <n7cq9n$kpd$1@news.mixmin.net> 
  aitch <foo@bar.invalid> wrote:
> An easier way, would be to generate /all/ the sig files in one fell 
> swoop.  E.g. to generate signatures for "foo" and "bork", as well as the 
> default signature, get cron to run this (or something similar):

Yeah, that is the way to go.

> #v+
> #!/bin/sh
> # Generate signature files.

> declare -A sigtxt
> sigtxt=(
>   [foo]='Text for foo sig.'
>   [bork]='Text for bork sig.'
> )

I've never seen that syntax. Interesting.

I just did a straight 

echo .bork_sig > .signature_bork
echo .foo_sig > .signature_foo
echo $(~/bin/fortune ~/mysigs) > .signature
echo .signature >> .signature_bork
echo .signature >> .signature_foo

But a loop is better.

> cmdout=$( /usr/games/fortune -s )

> echo "$cmdout" > "$HOME/.signature"
> for id in "${!sigtxt[@]}" ; do
>   echo -e "${sigtxt[$id]}\n$cmdout" > "$HOME/.${id}_signature"
> done
> #v-



-- 
IT IS NOT YET MIDNIGHT?  'I shouldn't think it's more than a quarter
past eleven.' THEN WE HAVE THREE-QUARTERS OF AN HOUR 'How can you be
sure?' BECAUSE OF DRAMA, MISS FLITWORTH.. THE KIND OF DEATH WHO POSES
AGAINST THE SKYLINE AND GETS LIT UP BY LIGHTNING FLASHES, said Bill
Door, disapprovingly, DOESN'T TURN UP AT FIVE-AND-TWENTY PAST ELEVEN IF
HE CAN POSSIBLY TURN UP AT MIDNIGHT.
Technical Details
Message-ID: <slrnn9kigr.3ig.g.kreme@amelia.local>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
References: <slrnn8vlkv.1uv8.g.kreme@amelia.local> <slrnn918mb.hd9.jbn@forestfield.org> <n7cq9n$kpd$1@news.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrnn9kigr.3ig.g.kreme@amelia.local>
Subject: Re: [slrn] Modify signature based on newsgroup
Date: Sat, 16 Jan 2016 13:45:27 +0000
From: Lewis <g.kreme@gmail.com.dontsendmecopies>
References: <slrnn8vlkv.1uv8.g.kreme@amelia.local> <slrnn918mb.hd9.jbn@forestfield.org> <n7cq9n$kpd$1@news.mixmin.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.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers
Organization: Miskatonic U
Lines: 47
Injection-Date: Sat, 16 Jan 2016 13:45:27 -0000 (UTC)
Injection-Info: kreme.eternal-september.org; posting-host="67a6ffcad0084cff2eaf00478b4e9e19";
 logging-data="13099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nz2tGU8X+gc2F/AkfvcAX"
User-Agent: slrn/1.0.2 (Darwin)
X-Face: )^b5"R:T7U>9~:PEn3YkzMfW*[b1qKeU.fP9C8~8HpU9}lA&6`bH1z
Cancel-Lock: sha1:SgrkfJZOHyWDDO0eC2BNs/xxxIo=
X-Clacks-Overhead: GNU Terry Pratchett
Mail-Copies-To: nobody
X-Received-Bytes: 2564
X-Received-Body-CRC: 731579605