⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex60.sh

📁 Shall高级编程
💻 SH
字号:
#!/bin/bash# Functions and parametersDEFAULT=default                             # Default param value.func2 () {   if [ -z "$1" ]                           # Is parameter #1 zero length?   then     echo "-Parameter #1 is zero length.-"  # Or no parameter passed.   else     echo "-Param #1 is \"$1\".-"   fi   variable=${1-$DEFAULT}                   #  What does   echo "variable = $variable"              #+ parameter substitution show?                                            #  ---------------------------                                            #  It distinguishes between                                            #+ no param and a null param.   if [ "$2" ]   then     echo "-Parameter #2 is \"$2\".-"   fi   return 0}echo   echo "Nothing passed."   func2                          # Called with no paramsechoecho "Zero-length parameter passed."func2 ""                       # Called with zero-length paramechoecho "Null parameter passed."func2 "$uninitialized_param"   # Called with uninitialized paramechoecho "One parameter passed."   func2 first           # Called with one paramechoecho "Two parameters passed."   func2 first second    # Called with two paramsechoecho "\"\" \"second\" passed."func2 "" second       # Called with zero-length first parameterecho                  # and ASCII string as a second one.exit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -