kfl62 kfl62 - 1 year ago 87
Bash Question

Environment variables in symbolic links

Can we use $HOME or other environment variable in symbolic links?

I know about using relative paths

but sometimes are to many
:) something like
would be more comfortable, or use of $HOME.


habbie's answer with psmears's comment is the answer, sorry my question was incomplete.

While (as other answers show) you can use environment variables when creating symbolic links (as with any shell command!), you can't actually have environment variable (or '~') references in the symlink itself

Answer Source

Symbolic links are handled by the kernel, and the kernel does not care about environment variables. So, no.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download