$* the arguments after the command as a string, [email protected] understood as a number of individual parameters, similar to the interpretation of data
[Email protected] test]#/test4.sh JSKD sj212 2 1 theUsing the $* METHOD:JSKD sj212 2 1 theUsing The [email protected] METHOD:JSKD sj212 2 1 the------------------------------$* Parameter # = JSKD sj212 2 1 the[email protected] Parameter #count=Jskd[email protected] Parameter #count=Sj21[email protected] Parameter #count=2[email protected] Parameter #count=2[email protected] Parameter #count=1[email protected] Parameter #count= the[email protected] test]#
#!/bin/bash#testing $*and [email Protected]echo"Using The \$* method: $*"Echo"Using the \[email Protected] method: [Email protected]"Echo------------------------------ forParaminch "$*" DoEcho"\$* parameter # $count = $param"Count=$[$count +1]donecount=1 forParaminch "[email protected]" DoEcho"\[email protected] Parameter #count = $param"Count=$[$count +1]done~
if [str1 = str2] When two strings have the same content, the length is true
if [str1! = str2] When string str1 and str2 are not equal
If [-N str1] is true when the length of the string is greater than 0 (string non-null)
If [-Z str1] is true when the length of the string is 0 (empty string)
If [str1] is true when string str1 is non-empty
Linux $* and [email protected]