无法用谷歌搜索的机器代码或其他难以读取的 EUID 部分
不确定是混淆、机器代码还是其他什么。请让我知道该部分的用途以及如何阅读它。该部分来自文件。
###############################################################################
# Set prompt based on EUID
################################################################################
if (( EUID == 0 )); then
PROMPT=$'%{\e[01;31m%}%n@%m%{\e[0m%}[%{\e[01;34m%}%3~%{\e[0;m%}]$(pc_scm_f)%# '
else
PROMPT=$'%{\e[01;32m%}%n@%m%{\e[0m%}[%{\e[01;34m%}%3~%{\e[0;m%}]$(pc_scm_f)%% '
fi
有人可以把它分成更多的部分吗?
- 条件
EUID == 0
的作用是什么? - 我使用 OBSD 时收到有关
pc_scm_f
的错误,它在其他操作系统中是否有某种值? \e
启动某种逻辑部分,其余部分做什么?
Not sure whether obfuscated, machine-code or something else. Please, let me know what the part is for and how to read it. The part is from the file.
###############################################################################
# Set prompt based on EUID
################################################################################
if (( EUID == 0 )); then
PROMPT=
could someone break it a bit more into parts?
- What does the conditional
EUID == 0
do?
- I get an error about
pc_scm_f
, using OBSD, is it some sort of value in other OS?
- the
\e
starts some sort of logical part, what do the rest do?
%{\e[01;31m%}%n@%m%{\e[0m%}[%{\e[01;34m%}%3~%{\e[0;m%}]$(pc_scm_f)%# '
else
PROMPT=
could someone break it a bit more into parts?
- What does the conditional
EUID == 0
do?
- I get an error about
pc_scm_f
, using OBSD, is it some sort of value in other OS?
- the
\e
starts some sort of logical part, what do the rest do?
%{\e[01;32m%}%n@%m%{\e[0m%}[%{\e[01;34m%}%3~%{\e[0;m%}]$(pc_scm_f)%% '
fi
could someone break it a bit more into parts?
- What does the conditional
EUID == 0
do? - I get an error about
pc_scm_f
, using OBSD, is it some sort of value in other OS? - the
\e
starts some sort of logical part, what do the rest do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对我来说看起来像 ANSI 转义序列。
Looks like ANSI escape sequences to me.
我发现 此链接 似乎在正确的上下文中包含了整个内容。
还告诉我 Ferruccio 是对的:它是一个 ANSI 转义字符串,用于更改命令提示符的样式。 \e 开始转义码,剩下的就是代码本身。在旧的 DOS 时代曾经非常流行,尤其是一款名为 NetHack 的游戏。它对于你的控制台来说只是漂亮的打印。
I found this link which seems to contain the whole thing in proper context.
Also tells me Ferruccio is right: It's an ANSI escape string, used to change the style of the command-prompt. \e starts the escape codes, the rest is the code itself. Used to be very popular in the old DOS time, especially with a game called NetHack. It's just pretty-print for your console.