usage-message.sh
来自「一本完整的描述Unix Shell 编程的工具书的所有范例」· Shell 代码 · 共 17 行
SH
17 行
#!/bin/bash# usage-message.sh: ${1?"Usage: $0 ARGUMENT"}# Script exits here if command-line parameter absent,#+ with following error message.# usage-message.sh: 1: Usage: usage-message.sh ARGUMENTecho "These two lines echo only if command-line parameter given."echo "command line parameter = \"$1\""exit 0 # Will exit here only if command-line parameter present.# Check the exit status, both with and without command-line parameter.# If command-line parameter present, then "$?" is 0.# If not, then "$?" is 1.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?