Hi,
I'm working as system admin. Very often I have to change config files
on a couple of unix boxes. So I edit a local copy of e.g. /etc/hosts,
copy the file to the targets and still have the master on my laptops
disk.
For this task I wrote a simple lisp routine (forgive me, I'm by no
means a lisp programmer, I'm just an Xemacs user).
In the master file I put the targets like this, using the appropiate
comment syntax:
...
10.1.1.37 rs00fk210 # Gateway VSE
# Local Variables:
# rcpbuf-todo: ("root@coco:/etc/inet/hosts" "root@dada:/etc/inet/hosts"
"root@fifi:/etc/inet/hosts" "root@gogo:/etc/inet/hosts")
# End:
My function looks like this:
(defun save-buffer-rcp()
"Sichert den aktuellen Buffer und startet die Shell-Prozedur rcpbuf"
(interactive)
(save-buffer) ; buffer-file-name enth�lt die vollst�ndige
; Dateibezeichnung der aktuellen Datei
(message "%s wurde gesichert" buffer-file-name )
; Den folgenden Aufruf mit
; "concat" habe ich irgendwo
; bei dired... abgeguckt
(setq list rcpbuf-todo)
(while list
(setq aktfil (car list))
(message "%s ..." (concat "scp -p " buffer-file-name " " aktfil))
(shell-command (concat "scp -p " buffer-file-name " " aktfil))
(setq list (cdr list)))
(message "rcpbuf beendet ...")
)
So it ends up in calling scp.
This is by no means really flexible. Sometimes I could use rcp instead
of scp, which I couldn't manage to put in this schema.
I'm wondering whether rcp.el can be used in this scenario ...
Thanks
Gerd