ex49.sh

来自「Shall高级编程」· Shell 代码 · 共 23 行

SH
23
字号
#!/bin/bash# Changes a file to all uppercase.E_BADARGS=65if [ -z "$1" ]  # Standard check for command line arg.then  echo "Usage: `basename $0` filename"  exit $E_BADARGSfi  tr a-z A-Z <"$1"# Same effect as above, but using POSIX character set notation:#        tr '[:lower:]' '[:upper:]' <"$1"# Thanks, S.C.exit 0#  Exercise:#  Rewrite this script to give the option of changing a file#+ to *either* upper or lowercase.

⌨️ 快捷键说明

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