UNIX Hints & Hacks

ContentsIndex

Chapter 8: Editors

 

Previous ChapterNext Chapter

Sections in this Chapter:

   

8.1 The Anatomy of ed & vi

 

8.5 Abbreviating vi Commands

 

 

8.2 The Six Steps to ed

 

8.6 Creating Macros

 

8.10 Edit, Run, and Edit Again

 

8.3 Six Simple Steps to vi

 

8.7 Search and Replace

 

8.11 Reading STDOUT into vi

 

8.4 Configuring vi Parameters

 

8.8 Other Places to Use vi

 

8.12 Using vi when tmp Is Full

 

 

8.12 Using vi when tmp Is Full

8.12.1 Description

8.12.1 Description

If the partition is full where the defined temporary space is, vi crashes and never loads. These areas are usually set by default to /tmp, /usr/tmp, and /var/tmp. It makes use of the temporary space to store a copy of the file being edited. If the system were to crash it would use this temporary file to recover the file.

Flavors: AT&T, BSD

Shells: All

Syntax:

set directory=absolute_path

To get vi up and running all you have to do is set vi to look and write to a different temporary area. This can be done by setting the directory parameter for vi.

If you are using sh or ksh shells, place the parameter setting into the .profile your home directory.

EXINIT='set directory=/bigdisk/tmp'
export EXINIT

If you are using the csh or tcsh shells, make the additions to your .cshrc or .login file and re-source the file.

setenv EXINIT 'set directory=/bigdisk/tmp'

The last place that you can put the parameter setting is within the .exrc file in your home directory. Keep in mind that the EXINIT variable in your login scripts take precedence over the .exrc file.

Reasons

The system's temporary space fills up and you generally have no control over it. If possible and another temporary space is available with much more disk space, you might want to hardcode the setting into your login scripts or .exrc file so you will not get hit with this problem.

Real World Experience

I've seen in some instances where administrators have attempted to hardcode the directory parameter for root to another area off the system drive. The first time that the partition containing the temporary area didn't mount, vi was useless. For root, you should leave it alone and accept the default setting for it.

Other Resources

Man page:

vi

UNIX Hints & Hacks

ContentsIndex

Chapter 8: Editors

 

Previous ChapterNext Chapter

Sections in this Chapter:

   

8.1 The Anatomy of ed & vi

 

8.5 Abbreviating vi Commands

 

 

8.2 The Six Steps to ed

 

8.6 Creating Macros

 

8.10 Edit, Run, and Edit Again

 

8.3 Six Simple Steps to vi

 

8.7 Search and Replace

 

8.11 Reading STDOUT into vi

 

8.4 Configuring vi Parameters

 

8.8 Other Places to Use vi

 

8.12 Using vi when tmp Is Full

 

 

© Copyright Macmillan USA. All rights reserved.