summaryrefslogtreecommitdiff
path: root/entry
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-04-08 23:14:53 +0000
committerJohn Wiegley <johnw@newartisans.com>2004-04-08 23:14:53 +0000
commit83b7a0ea9ca681893544c11160fc85e201da2937 (patch)
tree7f267f571bf113b07d7e6cd3874082aa11a5b5fd /entry
parent250248fd9e868e2afb7cd2b94506834d5542846b (diff)
downloadfork-ledger-83b7a0ea9ca681893544c11160fc85e201da2937.tar.gz
fork-ledger-83b7a0ea9ca681893544c11160fc85e201da2937.tar.bz2
fork-ledger-83b7a0ea9ca681893544c11160fc85e201da2937.zip
Several small fixes.
Diffstat (limited to 'entry')
-rwxr-xr-xentry16
1 files changed, 16 insertions, 0 deletions
diff --git a/entry b/entry
new file mode 100755
index 00000000..28daf8c8
--- /dev/null
+++ b/entry
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ -z "$LEDGER" -o ! -r $LEDGER ]; then
+ echo Please set your LEDGER environment variable.
+fi
+
+line=`wc -l $LEDGER | awk '{print $1}'`
+
+if ledger entry "$@" > /tmp/entry; then
+ cat /tmp/entry >> $LEDGER
+else
+ echo "$@" >> $LEDGER
+fi
+rm /tmp/entry
+
+vi +$line $LEDGER