首页 > 系统服务 > 详细

linux基础篇-13,命令替换$()

时间:2016-11-23 08:31:06      阅读:319      评论:0      收藏:0      [点我收藏+]

[root@localhost ~]# echo it is the time $(clock)

it is the time 2016年11月10日 星期四 18时20分38秒 -0.327027 seconds


命令替换

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# ll ./

总用量 44


-rw-r--r--. 1 root root     0 11月 10 14:34 201711201500

-rw-------. 1 root root  1367 7月  20 00:30 anaconda-ks.cfg

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-04.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-05.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-06.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-07.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-08.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-09.txt

-rw-r--r--. 1 root root     0 11月 10 18:25 file-.txt

-rw-r--r--. 1 root root 27828 7月  20 00:30 install.log

-rw-r--r--. 1 root root  7572 7月  20 00:28 install.log.syslog


本文出自 “James zhan Linux高级运维” 博客,请务必保留此出处http://jameszhan.blog.51cto.com/10980469/1875542

linux基础篇-13,命令替换$()

原文:http://jameszhan.blog.51cto.com/10980469/1875542

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