孤独雪鹰 发表于 2018-8-27 11:31:52

shell位置变量详解

#脚本test2.sh中的内容#!/bin/bashecho 'This is a test for $* and $@'echo 'The following start printing $*'echo $*  
./test4.sh $*echo 'The following start printing $@'echo $@./test4.sh $*echo 'The following start printing $# with ""'echo "$*"./test4.sh "$*"echo 'The following start printing $@ with ""'echo "$@"./test4.sh"$@"#脚本test4.sh中的内容#!/bin/bashecho $#执行结如下:
  
$ ./test2.sh a b c e
  
This is a test for $* and $@The following start printing $*
  
a b c e4The following start printing $@a b c e4The following start printing $# with ""a b c e1The following start printing $@ with ""a b c e4


页: [1]
查看完整版本: shell位置变量详解