命令替换

使用命令执行的结果来替换该命令

语法:$(命令)

[root@localhost ~]# touch file-$(date +%Y-%m-%d-%H:%M:%S)

[root@localhost ~]# ls
anaconda-ks.cfg file- file-2022-02-09-12:11:47 file-2022-02-09-12:13:09

posted @ 2022-02-09 14:34  a龙  阅读(49)  评论(0编辑  收藏  举报