摘要:
1 #!/bin/bash 2 # can only login in with root and root 3 # pay attention to the "-a" in the if condition, it means "and" 4 echo "Login as:" 5 read name 6 echo "Password:" 7 stty -echo # this is to hide the password input 8 read password 9 stty echo # this to r
阅读全文
摘要:
1 1 #!/bin/bash 2 2 3 4 sum=0 4 5 5 6 if [ $# -eq 0 ] # if no parameter 6 7 then 7 8 echo 'Usage [number1] [number2] ...' 8 9 exit 1 9 10 fi10 11 for i in $*11 12 do 12 13 sum=`expr $sum \+ $i`13 14 shift ...
阅读全文