1
有人可以在makefile中解释以下代码的含义吗?makefile或shell命令中的〜意味着什么?
@mv [email protected]~ [email protected]
经过一番搜索,我想这意味着shell命令:
mv [email protected]~ [email protected]
但什么是[email protected]~
?
有人可以在makefile中解释以下代码的含义吗?makefile或shell命令中的〜意味着什么?
@mv [email protected]~ [email protected]
经过一番搜索,我想这意味着shell命令:
mv [email protected]~ [email protected]
但什么是[email protected]~
?
这看起来像一个bash脚本不止一个makefile。
[email protected]
表示序列化为文本列表的所有当前命令行参数(当前脚本的参数)。
~
在开始的一个文件名,它将被扩展并且通常指您的$HOME
。 波浪线扩展Reference
~
在一个文件名,它只是一个普通字符的年底。 公约意味着它是一个备份文件Reference
因此mv [email protected]~ $~
命令将
如果你有这个目录:
/foo.txt~
/bar.txt~
/baz.txt~
然后运行命令:
./yourscript.sh foo.txt baz.txt
目录内容将变为:
/foo.txt
/bar.txt~
/baz.txt
'$ @〜'扩展'$ @'第一(留字分裂和预留通配符问题),这意味着只有_last_参数以'〜'结尾;尝试'设置 - 一个B;回声$ @〜'。 – mklement0