一、
command命令在shell脚本里面,如果发现有个函数和我们需要执行的命令同名,我们可以用command用来强制执行命令,而不是同名函数,即无视shell脚本中的“同名”函数,执行特定的命令
二、实例:
function ls()
{
echo "haha"
}
echo "--1--"
ls
echo "--2--"
command ls
echo "--3--"
echo command ls
echo "--4--"
$(echo command ls)
输出结果:
user@PC:~/debug/bin/test$ ./test.sh
--1--
haha
--2--
test.sh
--3--
command ls
--4--
test.sh
ref