In VI editor you can get
the output of any shell
command command inserted
into the file you are
editing by using:
:r!
For example:
:r!who -r
inserts the ouput of the
command "who -r" to the
file currently being
edited.
This can be effectively used
to copy the contents of a
file to the file currently
being edited
ie,
:r!cat /etc/passwd
inserts all the contents of
the the /etc/passwd to the
file currently being edited.
This tip supported by: Prem Kumar S NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
production.