From: Edward Delaporte Date: Wed, 3 Jun 2026 22:19:05 +0000 (-0500) Subject: Update to use bash shell X-Git-Url: https://us-delaporte.pagekite.me/gitweb/minion.git/commitdiff_plain/71ccf7cbe021ab4cbd096d99f1ddac35fe88b005?ds=inline Update to use bash shell --- diff --git a/bin/mh b/bin/mh index df48f4c..18f19c4 100755 --- a/bin/mh +++ b/bin/mh @@ -1,19 +1,24 @@ -#!/usr/bin/fish +#!/usr/bin/bash echo "Usage:" echo "" echo "mn - minion new - edit a new file with the year and month in the name" echo "mh - minion help - print this help" echo "ml - minion list - list all files that match" -echo "mp - minion print - convert matching files to HTML and open in Firefox (requires https://github.com/gomarkdown/markdown)" echo "mo - minion open - open all files that match" -echo "ms - minion spell - open the matching file with `aspell`" echo "" echo "Examples:" echo "" -echo "mn meeting topic - open a file Journal/2026/04-meeting-topic.md" +echo "mn meeting topic - open a (new) file Journal/2026/04-meeting-topic.md" echo "ml 04 - list files created in April" echo "mo manager - open files named with 'manager' to edit" echo "" -echo "mla, moa - minion X all - act as `ml` and `mo`, but include all previous years of Journal entries" +echo "Advanced Usage:" +echo "" +echo "mp - minion print - convert matching files to HTML and open in Firefox (requires https://github.com/gomarkdown/markdown)" +echo "ms - minion spell - open the matching file with 'aspell'" +echo "mla, moa - minion X all - act as 'ml' and 'mo', but include all previous years of Journal entries" +echo "" +echo "On vi integration:" +echo "" echo "In vi - :r!ml will add list of files to the current buffer" echo "In vi - gf - opens the file name under the cursor - as long as it has no spaces" diff --git a/bin/ml b/bin/ml index 4acb211..b622021 100755 --- a/bin/ml +++ b/bin/ml @@ -1,3 +1,3 @@ -#!/usr/bin/fish -set year (date +%Y) -find $HOME/Journal/$year -type f -iname "*$argv*\.md" +#!/usr/bin/bash +year=`date +%Y` +find $HOME/Journal/$year -type f -iname "*$1*\.md" diff --git a/bin/mla b/bin/mla index 38103ea..95f115d 100755 --- a/bin/mla +++ b/bin/mla @@ -1,2 +1,2 @@ -#!/usr/bin/fish -find $HOME/Journal -type f -iname "*$argv*\.md" +#!/usr/bin/bash +find $HOME/Journal -type f -iname "*$1*\.md" diff --git a/bin/mn b/bin/mn index 92f3eb8..f3b823a 100755 --- a/bin/mn +++ b/bin/mn @@ -1,6 +1,10 @@ -#!/usr/bin/fish -set year (date +%Y) -set input $(string join '-' $argv) -set topic $(string replace -a ' ' '-' $input) +#!/usr/bin/bash +year=`date +%Y` +input=$@ +topic=${input// /-} mkdir -p "$HOME/Journal/$year" -vim $(printf "$HOME/Journal/$year/%02d-$topic.md" (date +%m)) +if [ !x"${EDITOR}" ]; then + export EDITOR=nano +fi +fname=$(printf "$HOME/Journal/$year/%02d-$topic.md" $(date +%m)) +$EDITOR $fname diff --git a/bin/mo b/bin/mo index 2ebc8db..7f4d046 100755 --- a/bin/mo +++ b/bin/mo @@ -1,3 +1,7 @@ -#!/usr/bin/fish -set year (date +%Y) -vim $(find $HOME/Journal/$year -type f -iname "*$argv*\.md") +#!/usr/bin/bash +year=`date +%Y` +files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md") +if [ !x"${EDITOR}" ]; then + export EDITOR=nano +fi +$EDITOR $files diff --git a/bin/moa b/bin/moa index f11065e..ea4ea99 100755 --- a/bin/moa +++ b/bin/moa @@ -1,2 +1,6 @@ -#!/usr/bin/fish -vim $(find $HOME/Journal -type f -iname "*$argv*\.md") +#!/usr/bin/bash +files=$(find $HOME/Journal -type f -iname "*$1*\.md") +if [ !x"${EDITOR}" ]; then + export EDITOR=nano +fi +$EDITOR $files diff --git a/bin/ms b/bin/ms index 76e9dfd..e969043 100755 --- a/bin/ms +++ b/bin/ms @@ -1,2 +1,3 @@ -#!/usr/bin/fish -aspell check "$(ml $argv)" +#!/usr/bin/bash +files=$(ml $1) +aspell check $files