shell/ not bash/

This commit is contained in:
bth 2024-01-14 11:57:10 -08:00
commit 4870919531
15 changed files with 0 additions and 0 deletions

23
shell/next.sh Executable file
View file

@ -0,0 +1,23 @@
# Get the file name in any numbered series of text files and open with emacs
# Usage:
# $ next [descriptor]
# Handles an optional string descriptor. Like this:
# $ ls
# 011.blah.md
# $ next foo
# 012.foo.md
# File format:
# in regex terms:
# [0-9]+\.[.*\.]*md|txt
# in plain terms:
# [leadings numbers with consistent width].[optional string descriptor and . separator][md|txt]
# NOTE the optional $1 arg passed to awk with -v:
NEXTFILE=`$UMBASEPATH/last.sh | awk -f $UMBASEPATH/next.awk -v arg=$1`
# HACK: emacs won't accept piped input as a file name, so we use --eval to open
# the file via find-file.
emacsclient --eval "(progn (find-file \"$NEXTFILE\") (uldb-journal-header) (message \"creating $NEXTFILE\"))"