首页 > 其他 > 详细

显示信息echo

时间:2014-11-06 17:47:25      阅读:247      评论:0      收藏:0      [点我收藏+]

echo命令结果和echo文本字符串在同一行显示,实现如下:

只需要加 -n 参数即可

[root@localhost ~]# cat 1.sh 

#!/bin/bash

#This script displays the date and who‘s logged on

echo The time and date are:

date 

echo  Let‘s see who‘s logged into the system:

who

*********************************************************

root@localhost ~]# ./1.sh 

The time and date are:

2014年 11月 06日 星期四 14:59:28 CST

Lets see whos logged into the system:

root     pts/1        2014-11-06 09:03 (192.168.18.22)


************************************************************

[root@localhost ~]# cat 1.sh 

#!/bin/bash

#This script displays the date and who‘s logged on

echo -n  The time and date are:

date 

echo  Let‘s see who‘s logged into the system:

who

**************************************************************

[root@localhost ~]# ./1.sh 

The time and date are:2014年 11月 06日 星期四 15:00:36 CST

Lets see whos logged into the system:

root     pts/1        2014-11-06 09:03 (192.168.18.22)


本文出自 “linux运维分享” 博客,请务必保留此出处http://liangey.blog.51cto.com/9097868/1573433

显示信息echo

原文:http://liangey.blog.51cto.com/9097868/1573433

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!