我需要帮助在 shell 脚本中找到数据集 table 的最小和最大数量
i need help finding the min and max numbers of a dataset table in shell script
我需要帮助在 shell 脚本中查找数据集 table 的最小和最大数量。
min=$(awk -F ',' -v min=999 'NR!=1 {if($'"$i"'<min){min=$'"$i"'}} END{print min}' $filename)
有更简单的方法吗?
可以使用排序 manual and sed (for first and last)
如 sort -t , -k 2 the_file | sed -e 1b -e '$!d'
我需要帮助在 shell 脚本中查找数据集 table 的最小和最大数量。
min=$(awk -F ',' -v min=999 'NR!=1 {if($'"$i"'<min){min=$'"$i"'}} END{print min}' $filename)
有更简单的方法吗?
可以使用排序 manual and sed (for first and last)
如 sort -t , -k 2 the_file | sed -e 1b -e '$!d'