ex24.sh

来自「一本完整的描述Unix Shell 编程的工具书的所有范例」· Shell 代码 · 共 38 行

SH
38 行
字号
#!/bin/bash# Faxing (must have 'fax' installed).EXPECTED_ARGS=2E_BADARGS=65if [ $# -ne $EXPECTED_ARGS ]# Check for proper no. of command line args.then   echo "Usage: `basename $0` phone# text-file"   exit $E_BADARGSfiif [ ! -f "$2" ]then  echo "File $2 is not a text file"  exit $E_BADARGSfi  fax make $2              # Create fax formatted files from text files.for file in $(ls $2.0*)  # Concatenate the converted files.                         # Uses wild card in variable list.do  fil="$fil $file"done  efax -d /dev/ttyS3 -o1 -t "T$1" $fil   # Do the work.# As S.C. points out, the for-loop can be eliminated with#    efax -d /dev/ttyS3 -o1 -t "T$1" $2.0*# but it's not quite as instructive [grin].exit 0

⌨️ 快捷键说明

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