#!/bin/sh if [ $# != 1 ]; then echo "Usage: $0 FILE" exit 1 fi file="$1" sed 's/\\item//g' "$file" | sed 's/\\lots/.../g' | sed '/^\s*\\/d' | sed '/^\s*\%/d' | wc -w