Linux Shell脚本之常用参数

1. 常用参数

$#:is a special variable that returns the number of arguments;else, it cant return length of string
$1:is a first argument
$2 :is a second argument
$n: is a ned argument

  • example 1
[root@server4 shells]# string='hello spark'
[root@server4 shells]# echo ${#string}
11