?
Solved

Nvi recovery program

Posted on 2006-07-13
3
Medium Priority
?
701 Views
Last Modified: 2013-12-16
I was editing an index.html page this morning on a remote Debian 3.1 server using vi, which I now know is nvi (I assumed it was vim, which I'm used to from other distros). I forgot to save the file and closed my SSH client.

I then received an e-mail as follows:

--------8<--------
From: Nvi recovery program [mailto:root@myhost.mysubnet]
Sent: 13 July 2006 09:55
To: rstaveley@myhost.mysubnet
Subject: Nvi saved the file index.html

On Thu Jul 13 08:54:11 2006, the user rstaveley was editing a file named index.html on the machine myhost.mysubnet, when it was saved for recovery. You can recover most, if not all, of the changes to this file using the -r option to vi:

      vi -r index.html
--------8<--------

I'm absolutely delighted with this. I fixed my error straight away.

Here's my question:

The company I work for uses pico for on-line text editing, because most people are more enlightened than I am. Does the equivalent of the Nvi recovery program exist for pico too, including the mail alert?
0
Comment
Question by:rstaveley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
pjedmond earned 500 total points
ID: 17098153
No it does not:(

However, if you use the command:

screen

before running pico, even if you get disconnected, you wont lose your work. On reconnecting, you type:

screen -r

or you may have to give:

screen -r screenid

and you are back to where you were before you were disconnected.

(   (()
(`-' _\
 ''  ''
0
 
LVL 17

Author Comment

by:rstaveley
ID: 17098221
That's very cool.

I've just tried putting the following into ~/.profile:

   screen -r || screen

It is nice, but doesn't handle screen resizes. The mail alert is what really tickled my fancy about nvi, though.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17098280
Pico (and nano)...are designed to be 'minimalistic' editors, hence their name! I think it unlikely that they would add such a function if the editor edited with an error. Even if it did, pico doesn't have any 'auto-backup' of progress process I'm afraid, so you wouldn't be able to recover anything.

>It is nice, but doesn't handle screen resizes.

Upgrade your version of screen. Although when you resize, it doesn't correctly fill additional blank space, the never versions of it definitely use the full 'screen' size.

(   (()
(`-' _\
 ''  ''

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question