doasedit
—
edit a text file and then write the file back to its original
location with admin access
The doasedit
utility opens an editor on a temporary copy
of a text file. Once the file has been altered, it is written back to the
original location, using doas for elevated access. This is intended for use in
editing configuration files where the user may need to be root to edit a file,
but does not wish to run their text editor as the super user.
The doasedit utility accepts one argument, the file to be edited.
The text editor used during the editing process is set using the EDITOR
environment variable.
The doasedit
utility exits 0 on success,
and >0 if an error occurs.
EDITOR
- The editor command used for editing the target text file. If no EDITOR
variable is set, then the command vi is used.