🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
8 messages
8 total messages Started by Sandman Thu, 24 Apr 2014 13:37
slrn and remote editor via ssh
#257389
Author: Sandman
Date: Thu, 24 Apr 2014 13:37
29 lines
1786 bytes
I use slrnon my Linux box, and connect to it from my Mac, and I want to use 
a Mac editor to edit posts, so I wrote this script:

---------------
#!/bin/bash
IFS=' '
read -a array <<< "${SSH_CONNECTION}";

remotehost=${array[0]}
myhost=${array[2]}
ssh sandman@${remotehost} /usr/local/bin/bbedit sftp://sandman@${myhost}/`pwd`/$1
--------------

That invokes bbedit on my Mac for editing posts from the currently 
connected Mac. I then set my editor command to:

	set editor_command "~/bin/quote.php; ~/bin/bbedit"

And it works! The "quote.php" is a script that pre-processes my replies and 
formats some stuff, and then it invokes the above script.

The only problem I'm having is that ssh doesn't "halt" the operation, but 
return control back to slrn as soon as it has established and slrn asks me 
if I want to post the message.

Any ideas?

-- 
Sandman[.net]
Re: slrn and remote editor via ssh
#257403
Author: Lewis
Date: Fri, 25 Apr 2014 04:46
31 lines
2425 bytes
In message <slrnlli521.m49.mr@irc.sandman.net> 
  Sandman <mr@sandman.net> wrote:
> I use slrnon my Linux box, and connect to it from my Mac, and I want to use 
> a Mac editor to edit posts, so I wrote this script:

> ---------------
> #!/bin/bash
> IFS=' '
> read -a array <<< "${SSH_CONNECTION}";

> remotehost=${array[0]}
> myhost=${array[2]}
> ssh sandman@${remotehost} /usr/local/bin/bbedit sftp://sandman@${myhost}/`pwd`/$1
> --------------

> That invokes bbedit on my Mac for editing posts from the currently 
> connected Mac. I then set my editor command to:

> 	set editor_command "~/bin/quote.php; ~/bin/bbedit"

> And it works! The "quote.php" is a script that pre-processes my replies and 
> formats some stuff, and then it invokes the above script.

> The only problem I'm having is that ssh doesn't "halt" the operation, but 
> return control back to slrn as soon as it has established and slrn asks me 
> if I want to post the message.

bbedit -w --resume +%d

-- 
Happy Jack wasn't tall, but he was a man
Re: slrn and remote editor via ssh
#257413
Author: Sandman
Date: Fri, 25 Apr 2014 12:00
39 lines
2193 bytes
In article <slrnlljq4i.la8.g.kreme@amelia.local>, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:

> In message <slrnlli521.m49.mr@irc.sandman.net> 
>   Sandman <mr@sandman.net> wrote:
>> I use slrnon my Linux box, and connect to it from my Mac, and I want to use 
>> a Mac editor to edit posts, so I wrote this script:
>
>> ---------------
>> #!/bin/bash
>> IFS=' '
>> read -a array <<< "${SSH_CONNECTION}";
>
>> remotehost=${array[0]}
>> myhost=${array[2]}
>> ssh sandman@${remotehost} /usr/local/bin/bbedit sftp://sandman@${myhost}/`pwd`/$1
>> --------------
>
>> That invokes bbedit on my Mac for editing posts from the currently 
>> connected Mac. I then set my editor command to:
>
>> 	set editor_command "~/bin/quote.php; ~/bin/bbedit"
>
>> And it works! The "quote.php" is a script that pre-processes my replies and 
>> formats some stuff, and then it invokes the above script.
>
>> The only problem I'm having is that ssh doesn't "halt" the operation, but 
>> return control back to slrn as soon as it has established and slrn asks me 
>> if I want to post the message.
>
> bbedit -w --resume +%d

Hmmm, ok, that seems to actually wait for the file to be saved and 
closed... But what does "+%d" do? It only opens an empty file named "+d%" 
in bbedit?



-- 
Sandman[.net]
Re: slrn and remote editor via ssh
#257455
Author: Lewis
Date: Sun, 27 Apr 2014 23:10
44 lines
2982 bytes
In message <slrnllkjnr.pp6.mr@irc.sandman.net> 
  Sandman <mr@sandman.net> wrote:
> In article <slrnlljq4i.la8.g.kreme@amelia.local>, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:

>> In message <slrnlli521.m49.mr@irc.sandman.net> 
>>   Sandman <mr@sandman.net> wrote:
>>> I use slrnon my Linux box, and connect to it from my Mac, and I want to use 
>>> a Mac editor to edit posts, so I wrote this script:
>>
>>> ---------------
>>> #!/bin/bash
>>> IFS=' '
>>> read -a array <<< "${SSH_CONNECTION}";
>>
>>> remotehost=${array[0]}
>>> myhost=${array[2]}
>>> ssh sandman@${remotehost} /usr/local/bin/bbedit sftp://sandman@${myhost}/`pwd`/$1
>>> --------------
>>
>>> That invokes bbedit on my Mac for editing posts from the currently 
>>> connected Mac. I then set my editor command to:
>>
>>> 	set editor_command "~/bin/quote.php; ~/bin/bbedit"
>>
>>> And it works! The "quote.php" is a script that pre-processes my replies and 
>>> formats some stuff, and then it invokes the above script.
>>
>>> The only problem I'm having is that ssh doesn't "halt" the operation, but 
>>> return control back to slrn as soon as it has established and slrn asks me 
>>> if I want to post the message.
>>
>> bbedit -w --resume +%d

> Hmmm, ok, that seems to actually wait for the file to be saved and 
> closed... But what does "+%d" do? It only opens an empty file named "+d%" 
> in bbedit?

IIRC it puts the cursor on the line following the headers, but it's been
awhile since I used BBEdit for USENET.


-- 
...but the senator, while insisting he was not intoxicated, could not
explain his nudity.
Re: slrn and remote editor via ssh
#257457
Author: Sandman
Date: Mon, 28 Apr 2014 05:50
28 lines
1888 bytes
In article <slrnllr3im.2ii.g.kreme@amelia.local>, Lewis wrote:

> > > Lewis:
> > > bbedit -w --resume +%d
> > 
> > Sandman:
> > Hmmm, ok, that seems to actually wait for the file to be saved and
> > closed... But what does "+%d" do? It only opens an empty file
> > named "+d%" in bbedit?
> 
> IIRC it puts the cursor on the line following the headers, but it's
> been awhile since I used BBEdit for USENET.

Oh, maybe they've changed it. Here's from the manual:

       +<line number>, filename:<line number>
            Go to line number. For example, to select line 33:

                    bbedit +33 filename
                    bbedit filename:33

            If a character offset specification ("filename:33:1") is additionally
            passed, it will be ignored but the preceding line specification will
            be honored.


-- 
Sandman[.net]
Re: slrn and remote editor via ssh
#257456
Author: Lewis
Date: Mon, 28 Apr 2014 06:01
29 lines
2530 bytes
In message <slrnllrr62.6ls.mr@irc.sandman.net> 
  Sandman <mr@sandman.net> wrote:
> In article <slrnllr3im.2ii.g.kreme@amelia.local>, Lewis wrote:

>> > > Lewis:
>> > > bbedit -w --resume +%d
>> > 
>> > Sandman:
>> > Hmmm, ok, that seems to actually wait for the file to be saved and
>> > closed... But what does "+%d" do? It only opens an empty file
>> > named "+d%" in bbedit?
>> 
>> IIRC it puts the cursor on the line following the headers, but it's
>> been awhile since I used BBEdit for USENET.

> Oh, maybe they've changed it. Here's from the manual:

>       +<line number>, filename:<line number>
>             Go to line number. For example, to select line 33:

The %d is telling slrn to substitute the number of the line after the
headers (or the first line in the post). SO BBEdit will see, for example

bbedit -w --resume +17

-- 
<jshock221> a freudian slip is when you say one thing but you're really
thinking about a mother.
<Spadgeroonie> no, a freudian slip is sexy underwear your mother wears
Re: slrn and remote editor via ssh
#257458
Author: Sandman
Date: Mon, 28 Apr 2014 06:12
53 lines
2942 bytes
In article <slrnllrrmk.1e5e.g.kreme@amelia.local>, Lewis wrote:

> > > > > Lewis:
> > > > > bbedit -w --resume +%d
> > > > 
> > > > Sandman:
> > > > Hmmm, ok, that seems to actually wait for the file to
> > > > be saved and closed... But what does "+%d" do? It only opens
> > > > an empty file named "+d%" in bbedit?
> > > 
> > > Lewis:
> > > IIRC it puts the cursor on the line following the headers, but
> > > it's been awhile since I used BBEdit for USENET.
> > 
> > Sandman:
> > Oh, maybe they've changed it. Here's from the manual:
> 
> > +<line number>, filename:<line number> Go to line number. For
> > example, to select line 33:
> 
> The %d is telling slrn to substitute the number of the line after
> the headers (or the first line in the post). SO BBEdit will see, for
> example

> bbedit -w --resume +17

Ah, so that's what's not working. I'm calling it from a shell script. But that's ok, I don't need the cursor to be anywhere special.

While we're at it. Here is my shell script:

-----------------------
#!/bin/bash
IFS=' '
read -a array <<< "${SSH_CONNECTION}";

remotehost=${array[0]}
myhost=${array[2]}

echo sftp://sandman@${myhost}/$1

ssh sandman@${remotehost} /usr/local/bin/bbedit -w --resume sftp://sandman@${myhost}/$1
-----------------------

Do you know if there is any way to reuse the currently available SSH connection? This command doesn't work when I'm behind a router. the "sftp" part is just fine, but it's specifically the "ssh sandman@${remotehost}" that isn't working.

(remotehost in this script is my Mac, myhost is my Linux server)

If I echo $SSH_CONNECTION, I get "<ip> #nr <ip> #port" <- so the #nr might be in reference to the SSH connection (it's not a pid).

Any ideas?

-- 
Sandman[.net]
Re: slrn and remote editor via ssh
#257459
Author: Adam Funk
Date: Mon, 28 Apr 2014 13:41
24 lines
2132 bytes
On 2014-04-27, Lewis wrote:

> In message <slrnllkjnr.pp6.mr@irc.sandman.net> 
>   Sandman <mr@sandman.net> wrote:
>> In article <slrnlljq4i.la8.g.kreme@amelia.local>, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:

>>> bbedit -w --resume +%d
>
>> Hmmm, ok, that seems to actually wait for the file to be saved and 
>> closed... But what does "+%d" do? It only opens an empty file named "+d%" 
>> in bbedit?
>
> IIRC it puts the cursor on the line following the headers, but it's been
> awhile since I used BBEdit for USENET.

It does that with emacs.  Is there any way to make slrn give it the
line number where I normally want to start typing (after the quoted
part), instead of at the top of the message body?


-- 
You know, there are many people in the country today who, through no
fault of their own, are sane. Some of them were born sane. Some of
them became sane later in their lives.            --― Graham Chapman
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