shell的touch命令不能拼接路径吗?

查看:137
本文介绍了shell的touch命令不能拼接路径吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

touch $path$x"/"$txt1,结果只能执行到"/"之前

解决方案

可以啊:

[root@iZ11eorublsZ tmp]# x=a
[root@iZ11eorublsZ tmp]# y=b
[root@iZ11eorublsZ tmp]# touch $x"/"$y
touch: cannot touch `a/b': No such file or directory
[root@iZ11eorublsZ tmp]# mkdir a
[root@iZ11eorublsZ tmp]# touch $x"/"$y
[root@iZ11eorublsZ tmp]# ll a/b
-rw-r--r-- 1 root root 0 Aug  5 13:11 a/b

把你的几个变量值也同时给出来,包括你执行的结果

这篇关于shell的touch命令不能拼接路径吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆