findnote() {
file=$(find $SPOOL -type f -name "$1")
if [ -z "$file" ] ; then
- [ -z "$quiet" ] || printf "no such note $1\n"
+ [ -z "$quiet" ] || printf "no such note $1\n" 1>&2
exit 1
fi
echo $file
findopen() {
file=$(find $SPOOL/open -type f -name "$1")
if [ -z "$file" ] ; then
- [ -z "$quiet" ] || printf "no such open note $1\n"
+ [ -z "$quiet" ] || printf "no such open note $1\n" 1>&2
exit 1
fi
echo $file
}
case $cmd in
+ category)
+ notefile=$(findnote $1)
+ printf "%s\n" $(basename $(dirname $notefile))
+ ;;
list)
case $1 in
-a) find $SPOOL/ack -type f -printf '%P\n' | sort -n