Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Nvi recovery program

Posted on 2006-07-13
3
Medium Priority
?
722 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

610 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