Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I keep a file in memory during editing?

Tags:

bash

vim

gnupg

Short version : echo "testing" | vim - | grep "good"

This doesn't work as vim won't output to a pipe. It says : "Vim: Warning: Output is not to a terminal". Any way to do this? Cross-editor support would be nice too.

I've tried named pipes, but vim won't open them.

Long version : echo $passw | gpg -q -d --passphrase-fd 0 $filename | vim - | "somehow gpg encrypt it using $passw and store it back in $filename".

I'm trying to edit a gpg encrypted file but would like to not have the decrypted file on disk at any time.

The full script is here : https://github.com/ptarjan/viencrypt

like image 276
Paul Tarjan Avatar asked May 26 '09 00:05

Paul Tarjan


1 Answers

Keep in mind that by default Vim will create a swap file on disk. Start vim with the following command to avoid it:

vim "+set noswapfile"
like image 155
too much php Avatar answered Sep 22 '22 02:09

too much php