Operating System - HP-UX
1833737 Members
2775 Online
110063 Solutions
New Discussion

Re: editing large file with vi

 
SOLVED
Go to solution
Bernd Dittmar
Advisor

editing large file with vi

i have to edit a large file with vi.
i gget the error "no space left on device".
How can i temporary change the "tmp-space" for vi ?
BaaN IV on HP-UX
7 REPLIES 7
Dan Hetzel
Honored Contributor

Re: editing large file with vi

Hi Bernd,

in your $HOME/.exrc file, put a line like the following:
directory=/wherever/you/want

This will set the temp directory to that location instead of the default /var/tmp

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Alex Glennie
Honored Contributor

Re: editing large file with vi

Not sure if this can be done ?

from man vi : Maximum File Size
The maximum file length of 234,239 lines is silently enforced.

Do a do a "wc -l" on the file if this exceeds
234,239 use the split(1) command to split these large files into smaller files, edit the smaller files and then use cat(1) to concatenate these files back may work ?
Tony Constantine_1
Regular Advisor

Re: editing large file with vi

vi defaults to /var/tmp, see if can clear down any unwanted log files in /var or can you increase your /var file system. Do a vgdisplay /dev/vg00 to see if you have any free PE's left

or you can put a entry in your .exrc file
directory=/home/

Dan Hetzel
Honored Contributor

Re: editing large file with vi

Hi Alex,

As the error message was "no space left on device", the problem doesn't seem to come from the file lenght.

Otherwise, you're right as 'split' can be used to break the file into smaller pieces.

The vi (visual) program is a display-oriented text editor that is based on the underlying ex line editor (see ex(1)), that's where the directory= stuff comes from.

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Tommy Palo
Trusted Contributor

Re: editing large file with vi

There's also a better vi at:
http://www.vim.org
whitout some of the limitations in HP-UX vi, and with lots of more useful features.
Keep it simple
Rainer_1
Honored Contributor
Solution

Re: editing large file with vi

before editing you can set the temorary directory to a filesystem that has sufficient space with

export TMPDIR=
Dan Hetzel
Honored Contributor

Re: editing large file with vi

Hi Bernd,

Have a look at this post from Stefan Farrelly:
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x94f05f260cafd4118fef0090279cd0f9!0,00.html

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com