$@$*区别

不加引号的时候没区别

#! /usr/bin/bash

function print_args_at {
    printf "%s\n" $@ 
    echo $@
}

function print_args_star {
    printf "%s\n" $*
    echo $*
}

print_args_at "one" "two three" "four"
echo "*******************************************"
print_args_star "one" "two three" "four"

输出结果

one
two
three
four
one two three four
*******************************************
one
two
three
four
one two three four
View Code

相关文章: