#! /usr/local/bin/zsh # # this file: # https://dataswamp.org/~incal/sth/scripts/hist # # data: # https://dataswamp.org/~incal/COMP-HIST setopt extendedglob item=$1 hist_file=~/public_html/COMP-HIST if [[ $# = 0 || $item == 'db' ]]; then url='https://dataswamp.org/~incal/COMP-HIST' entries=$(wc -l $hist_file | awk '{print $1}') echo "$url $entries entries" elif [[ $item = [0-9](#c4) ]]; then grep " ${item} " $hist_file | tr -s ' ' else grep -i "^${item} " $hist_file | head -n 1 | tr -s ' ' fi