#!/bin/bash # remindme--Searches a data file for matching lines or, if no # argument is specified, shows the entire contents of the data file. setvar rememberfile = ""$HOME/.remember"" if test ! -f $rememberfile { echo "$0: You don't seem to have a .remember file." >&2 echo "To remedy this, please use 'remember' to add reminders" >&2 exit 1 } if test $Argc -eq 0 { # Display the whole rememberfile when not given any search criteria. more $rememberfile } else { # Otherwise, search through the file for the given terms, and display # the results neatly. grep -i -- @ARGV $rememberfile | ${PAGER:-more} } exit 0