$ @和$ *之间的差异 [英] Difference between $@ and $*
本文介绍了$ @和$ *之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经编写了一个简单的脚本,该脚本可以使用任意数量的参数来演示$@
和$*
之间的区别:
I have wrote a simple script that takes in any number of parameters to demonstrate the difference between $@
and $*
:
#!/bin/bash
echo "double quoted $* $@"
echo 'single quoted $* $@'
在CLI上我做了
$./stuff.sh a b c d e f dfs
这就是打印出来的
double quoted a b c d e f dfs a b c d e f dfs
single quoted $* $@
由于它们相同,是否意味着$@
等于$*
?还是我想念的一点?
Since they are identical does that mean $@
equals to $*
? Or is there a point I am missing?
推荐答案
查看全文