Context dependent symlinks

Ive got multiple PCs, sharing an NFS mounted home dir. For certain apps I would like to keep the config files host specific. Easy solution is to create symlinks to local folders for configs. Ideally I would still want the .config files to reside in the user home folder.

Is it possible to create a symlink with a variable in its name that where the variable is expanded when the link is traversed, rather than when the link is created.

So far my searching has resulted only in some oracle cluster specific solutions. My hosts involved are running a mix of Slackware 12 and 13 x64.

Thanks

Very simple answer to that I'm afraid: No. A symlink is not dynamic like that in any way.

Why not just handle the dir in /etc/profile? That's what it's there for.

if [ -f /path/${to}/file ] 
then
        source /path/${to}/file
else
        source /etc/genericfile
fi
1 Like

Context dependent symlinks require the support of either the kernel, or the filesystem kernel module. On Linux, as far as I know, only OCFS offers that support.

1 Like