计算机网络/计算机科学与应用/系统/运维/开发

Linux echo命令-输出指定内容

echo 命令 在指定的字符串或者变量的值


# 输出一个字符串

[root@node-a shell]# echo "hello world"
hello world


# 输出变量

[root@node-a shell]# day="Sunday"
[root@node-a shell]# echo $day
Sunday


# 打印变量

[root@node-a shell]# echo $SHELL
/bin/bash


选项:

-n 不换行

[root@node-a shell]# echo -n "hello world"
hello world[root@node-a shell]#


热爱可抵岁月漫长, 温柔可挡艰难时光。

评论

^