#!/bin/bash # vi:set ts=8 sw=4 et sta: # # Author : Clark J. Wang # License: GPLv2 # # $Date$ # $Author$ # $HeadURL$ # $Revision$ # #--------------------------------------------------------------------# file=$1 if [ ! -f "$file" ]; then exit 1 fi saveIFS="$IFS" IFS=$'\n' lineno=0 while read -r line; do printf "%6u %s\n" $((++lineno)) "$line" done < "$file" IFS="$saveIFS"