shell/ not bash/
This commit is contained in:
parent
a725b5c0de
commit
4870919531
15 changed files with 0 additions and 0 deletions
23
shell/next.sh
Executable file
23
shell/next.sh
Executable 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\"))"
|
||||
Loading…
Reference in a new issue