|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
hi all,
I'm sorry for my english. I have this problem: I and my collegues can modify the same file at the same time. Is it possible delete this problem? The editor is VI. thanks. |
| Sponsored Links | ||
|
|
|
||||
|
Hi,
a solition might be ci/co, standard on HP-ux and Sun (and maybe more). It's a horrible apllication but it keeps you from these problems. Of course you can write a script that does, the folowing ? : #!/usr/local/bin/perl # Script that creates lock-file $file=$ARGV[0]; @last_f=split(/\//, $file ); @last_f=reverse @last_f; $last_f = $last_f[0]; if ( -f "/tmp/${last_f}" ) { print "Sorry, $last_f is still opened by someone else \n"; } else { `touch /tmp/${last_f}`; $cmd = sprintf("/usr/bin/vi %s",$file); $status = system($cmd); `rm /tmp/$last_f`; } Regs David |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please help to modify my script | Renjesh | Shell Programming and Scripting | 6 | 05-21-2008 09:08 AM |
| modify and use awk sed program | mnnarendra | Shell Programming and Scripting | 3 | 03-26-2008 01:08 PM |
| Modify files | amgo | UNIX for Advanced & Expert Users | 7 | 12-12-2005 09:19 AM |
| modify file using awk | nattynatty | Shell Programming and Scripting | 12 | 04-19-2002 12:59 PM |
| modify a file | yxiao | Shell Programming and Scripting | 2 | 03-26-2002 03:38 PM |