diff --git a/bash/next/next.sh b/bash/next/next.sh index cf6dfb5..b9359e7 100755 --- a/bash/next/next.sh +++ b/bash/next/next.sh @@ -64,7 +64,8 @@ # may in certain situations conflict with the alias. The link should be "next.sh" -> ~/config/.. # 4. NOTE: I use 'e' rather than 'emacs', to use my clever emacs/emacsclient function. -ls | egrep '^[[:digit:]].*\.md|txt' | tail -n 1 | awk ' + +NEXTFILE=`$UMBASEPATH/bash/last/last.sh | awk ' BEGIN { # set field separator, blank by default @@ -108,3 +109,6 @@ finalstr = sprintf("%s.%s", finalstr, $NF) END { print finalstr }' +` + +emacsclient --eval "(progn (find-file \"$NEXTFILE\") (journal) (message \"creating $NEXTFILE\"))" diff --git a/um b/um index eb3d487..47edd11 100755 --- a/um +++ b/um @@ -1,20 +1,22 @@ #!/bin/bash +# export so that we can use it in subscripts. +export UMBASEPATH=`realpath $0 | xargs dirname` + # catch first arguments with $1 case "$1" in next) - NEXTFILE=`./bash/next/next.sh $2` - emacsclient --eval "(progn (find-file \"$NEXTFILE\") (journal))" + $UMBASEPATH/bash/next/next.sh $2 ;; last) - ./bash/last/last.sh + $UMBASEPATH/bash/last/last.sh ;; cat) # all args but first - ./bash/mdcat/mdcat.sh "${@:2}" + $UMBASEPATH/bash/mdcat/mdcat.sh "${@:2}" ;; rename) - ./bash/rename/rename.sh "${@:2}" + $UMBASEPATH/bash/rename/rename.sh "${@:2}" ;; *) # else