#!/bin/bash
filename=${1:?"filename missing"}
howmany=${2:-10}
sort -nr $filename | head -$howmany
主要是 ' : ? ' 和 ' : - ' 的用法
: ? 的情况, 若参数没定义,捕捉错误,输出清算
: - 的情况, 若参数没定义,返回默认值
filename=${1:?"filename missing"}
howmany=${2:-10}
sort -nr $filename | head -$howmany
主要是 ' : ? ' 和 ' : - ' 的用法
: ? 的情况, 若参数没定义,捕捉错误,输出清算
: - 的情况, 若参数没定义,返回默认值

The quieter you become, the more you can hear