- 鱼用引号引起来的
\n
用换行符代替,因此您可以停止并重新启动引号(请注意在引号前不要加“ $”):
'这是一行'\ n'这是另一行'
- 鱼用引号引起来,因此您可以包括文字换行符:
'this is line
this is another line'
,
您可以使用echo -e
(启用反斜杠转义的解释),如@faho在其评论中指出的那样:
$ echo -e "## Foo\nBar"
## Foo
Bar
来自man echo
:
转义序列
If -e is used,the following sequences are recognized:
o \ backslash
o \a alert (BEL)
o \b backspace
o \c produce no further output
o \e escape
o \f form feed
o \n new line
o \r carriage return
o \t horizontal tab
o \v vertical tab
o \0NNN byte with octal value NNN (1 to 3 digits)
o \xHH byte with hexadecimal value HH (1 to 2 digits)
,
编辑您的config.fish
文件。
Ubuntu sudo nano /etc/fish/config.fish
中的示例
提示功能是控制鱼终端的外观的功能。粘贴此代码:
# Put system-wide fish configuration entries here
# or in .fish files in conf.d/
# Files in conf.d can be overridden by the user
# by files with the same name in $XDG_CONFIG_HOME/fish/conf.d
# This file is run by all fish instances.
# To include configuration only for login shells,use
# if status --is-login
# ...
# end
# To include configuration only for interactive shells,use
# if status --is-interactive
# ...
# end
#
function fish_prompt -d "Write out the prompt"
# change output color
set -U fish_color_command '2cff8f' -o
# Aliases
alias cls='clear'
# Prompt
printf '%s@%s%s%s%s\n@>' (whoami) (hostname | cut -d . -f 1) \
(set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end
本文链接:https://www.f2er.com/2722085.html