本文介绍了符号链接中的环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在符号链接中使用$ HOME或其他环境变量吗?

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

我知道使用相对路径../../.config,但是有时很多../都使用:)像~/.config这样的东西会更舒适,或者使用$ HOME.

I know about using relative paths ../../.config but sometimes are to many ../ :) something like ~/.config would be more comfortable, or use of $HOME.

habbie 的回答与的评论是答案,抱歉,我的问题不完整.

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

虽然(如其他答案所示)在创建符号链接时可以使用环境变量(就像使用任何shell命令一样!),但是符号链接本身实际上不能包含环境变量(或'〜')引用

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

推荐答案

符号链接由内核处理,并且内核不关心环境变量.所以,不.

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

这篇关于符号链接中的环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 18:28