Results 1 to 1 of 1
I've read the man page for the "ln" command and read there is an option that will not overwrite a symbolic link if one of the same name already exists.
...
- 06-30-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 1
symbolic link suffix
I've read the man page for the "ln" command and read there is an option that will not overwrite a symbolic link if one of the same name already exists.
For example, if I already have a symbolic link called "myfile.txt" and attempt to create another one, there is an option for making a backup of the existing link file without overwriting it (i.e., I would now have a link called myfile.txt and one called myfile.txt.~1~). To me, this seemed ideal for a simple shell script I am writing for scanning directories for audio and video files and creating symbolic links to them.
The problem I ran into, however, is that the backup symbolic links are hidden. I assume this is because of the tildes (i.e., the ~ character) in the name. Before this I thought only files beginning with a period were hidden.
I attempted to use the suffix option with "ln" so that it would not use a tilde in hopes of making visible symbolic links; however, nothing I have tried has worked. I keep ending up with backup filenames that contain a tilde.
Here is an example of what I have tried to change the suffix from ~ to something like #.
With this command, I still end up with a symbolic link of uupc_s02e16_high.ogg~1~ when an existing symbolic link to the file already exists. I would rather have a suffix that does not make the link hidden. I'm not particular on what the suffix is, just as long as it does not make the link hidden.Code:ln --backup=numbered --suffix=# -s /media/shared/uupc_s02e16_high.ogg
I've tried other characters for the suffix besides #, but still end up with the tildes.
Any help is appreciated.
Thanks.


Reply With Quote