1. write the file -> i get a warning it is r/o
2. force write ( :w! ) -> still can't write
3. run checkout script
4. vi now tells me that the file i'm editing is older than the file on disk. i press 'o' for o.k.
5. i write again (:w) -> still read only
6. force write (:w! ) -> vi says again that the file on disk is newer, and verifies if i really want to save, i answer yes.
i want to skip all this by doing it automatically
cheers,
erez.
Tzahi Fadida wrote:
what about a script? here is a script i wrote in 5 min. you are missing the "if" to check if the file is read only, i don't know what program can test that, but i am sure others know(p.s i used bash): #!/bin/sh PATH=/usr/ucb:/bin:/usr/bin:/usr/sbin MAILTO=root MAIL=/bin/mail CVSROOT=:pserver:[EMAIL PROTECTED]:/home/cvs/master cvs update $1 cvs edit $1 vi $1
* - * - * Tzahi Fadida MSc Student Information System Engineering Area Faculty of Industrial Engineering & Management Technion - Israel Institute of Technology Technion City, Haifa, Israel 32000 Email [EMAIL PROTECTED] Technion Email: [EMAIL PROTECTED] * - * - * - * - * - * - * - * - * - *
WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Erez Doron Sent: Thursday, September 18, 2003 1:15 PM To: Ilug Subject: vi question
hi
i am using a version control software i want vi to automatically checkout a file whenver i try to edit it while it is read-only. this includes running a command line, then reloading the file (because the date changes when i checkout the file), then let me edit it.
i want all to be automatically ( e.g. when i change the file)
how do i do that ( or part of it ) ?
cheers, erez
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]