Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/bin/rc/journal

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

# uses datefmt; see /n/sources/contrib/anothy/src/cmd/datefmt.c

rfork en

if (~ $journal '')
	journal=$home/lib/journal

if (! test -d $journal) {
	echo 'No journal at ' $journal >[1=2]
	exit badjournal
}

if (test $#* -lt 1) {
	echo 'usage: ' $0 ' /working/directory' >[1=2]
	exit usage
}
	
workdir=$1

now=`{datefmt %Y%m%d/%H%M}
entry=$journal/$now

mkdir -p $entry
dircp $workdir $entry

touch $entry/notes
if (! test -s $entry/notes)
	B $entry/notes

echo 'Created journal entry ' $journal/$now

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.