Dynamic Symlinks

I have actually constructed my application for various styles and also would love to create a "vibrant symlink" which takes me to the appropriate variation based upon a variable.

If the equipment I am presently visited to, is x86, after that the symlink needs to take me to that construct.

A buffooned instance of what I intend to do:

$ uname -i

$ ls -ltr 
lrwxr-xr-x  1 dogbane gg     4 Feb 16 15:40 mylink -> @sys/
drwxrwxr-x  2 dogbane gg  2048 Feb 16 15:40 x86_64/
drwxrwxr-x  2 dogbane gg  2048 Feb 16 15:40 i386/

$ cd mylink

$ pwd -P

Is this feasible?

I recognize I can make use of cd $(uname -i), yet desire something less complex.

2019-05-18 23:28:31
Source Share
Answers: 5

symlink is basically a documents with unique flag which has some course, and also this course took is, so you can not make one symlink to indicate various other areas because means. Yet you still might write manuscript that will certainly run apropriate construct.

2019-05-21 10:45:51

If you simply desire a less complex syntax to type than:

cd $(uname -i)

You can place it in a variable like:

 s=`uname -i` 

in your login manuscript, so you can simply do

 cd $s

When you intend to cd

2019-05-21 10:33:15

Symbolic web links are fixed: the filesystem simply shops a string, and also accesses to the symbolic link are rerouted to the documents whose name (about the area of the symlink) is that string.

It would certainly be straightforward to write a FUSE filesystem revealing such vibrant symlinks, yet I do not recognize of an existing one.

2019-05-21 10:30:22

I think this is binaries, so I would certainly do it with a PATH variable rater than symlink.


If you are making use of a device like cfengine or creature. A symlink to the ideal directory site can be developed based upon the system style.

2019-05-21 10:08:02

This attribute is sustained by DragonFly BSD, where it is called alternative symlinks . See man varsym and also man ln for information.

2019-05-19 13:57:27