Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://comet.sai.msu.ru/UNIXhelp/tasks/links2.2.2.html
Дата изменения: Fri Jan 17 12:43:24 1997 Дата индексирования: Tue Oct 2 01:06:54 2012 Кодировка: Поисковые слова: п п п п п п п п п |
You can make a symbolic link that points to a file that does not exist. The link becomes active when the file that it points to is created.
Removing the file does not affect the symbolic link itself and you can substitute another file for it to point to. Look at this example:
ln -s $HOME/accounts/pending current (make a symbolic link to a non-existent file) more current cat: accounts/pending: No such file or directory (this is what happens if you try to page it) cp ~/accounts/may ~/accounts/pending (now to create the file that the symbolic link points to) more current XYZ Co. Accounts for May 1993 ..... (and the symbolic link works) rm ~/accounts/pending; more current cat: accounts/pending: No such file or directory (removing the file makes the symbolic link inactive) cp ~/accounts/june ~/accounts/pending more current XYZ Co. Accounts for June 1993 ... (creating another file that the link points to makes it active once again)