[root@k8s-node02 test]# echo -e "\e[40m test content黑 \e[0m" test content黑 [root@k8s-node02 test]# echo -e "\e[41m test content红 \e[0m" test content红 [root@k8s-node02 test]# echo -e "\e[42m test content绿 \e[0m" test content绿 [root@k8s-node02 test]# echo...
[root@k8s-node02 test]# echo -e "\e[90m test content黑 \e[0m" test content黑 [root@k8s-node02 test]# echo -e "\e[91m test content红 \e[0m" test content红 [root@k8s-node02 test]# echo -e "\e[92m test content绿 \e[0m" test content绿 [root@k8s-node02 test]# echo ...
echo -e "\033[30m 黑色字 \033[0m" echo -e "\033[31m 红色字 \033[0m" echo -e "\033[32m 绿色字 \033[0m" echo -e "\033[33m 黄色字 \033[0m" echo -e "\033[34m 蓝色字 \033[0m" echo -e "\033[35m 紫色字 \033[0m" echo -e "\033[36m 天蓝字 \033[0m" echo -...
$ echo$'Hello\nworld'Hello world 1. 2. 3. 不过,我更喜欢使用-e标志。 使用echo 打印包含新行的内容 当你使用 echo 命令打印一段文本的时候,echo 命令会在文本的末尾自动添加一个换行符。 这意味着您可以将多个echo命令链接在一起以生成换行。看下面的例子: 复制 $ echoHello;echoworld Hello world ...
shell脚本基本命令echo shell脚本-e 语法: set [-可选参数] [-o 选项] 1. 一般“-” 表示启用某个参数,“+” 表示取消某个set曾启动的参数。与-<参数>相反 功能说明 set 指令可根据不同的需求来设置当前所使用 shell 的执行方式,同时也可以用来设置或显示 shell 变量的值。当指定某个单一的选项时将设置...
Shell中echo命令的用法 Shell中echo命令的⽤法 echo -n 表⽰不换⾏输出 echo -e 输出转义字符,将转义后的内容输出到屏幕上 常⽤的转义字符如下:\b 转义后相当于按退格键(backspace) ,但前提是"\b"后⾯存在字符; "\b"表⽰删除前⼀个字符, "\bb"表⽰删除前两个字符。[root@localhost ~]#...
把脚本第一行改成 !/bin/bash 就行了。echo -e是bash才能用的。sh默认是指dash。 用这个命令 ls -l `which sh`可以看到最右 lrwxrwxrwx 1 root root 4 7月 3 18:14 /bin/sh -> dash
一、echo命令 1、显示普通字符串: echo "小明" 2、显示转义字符: echo " "你好吗?" " 3、显示变量 age="18" echo ${age} 4、显示换行 echo -e "小明 \n你好吗? 好" 不换行 echo -e "小明 \n你好吗? \c" echo "好" -e 表示开启转移功能-c 表示不换行 ...
2、echo 命令 echo [选项][输出内容] 选项: -e:支持反斜线控制的字符转换 -n:取消输出后行末的换行符号 [root@hepingfly 桌面]# echo -e "a\tb" a b 小知识点: echo 输出字符串中含有感叹号会报错,解决方法就是在感叹号后面加一个空格 ...