From 161d6f79bd6f4ab45afa1cbae77548c8e508809a Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 26 Jul 2004 23:33:51 -0400 Subject: initial rev of 2.0 --- scripts/README | 5 ----- scripts/bal | 27 --------------------------- scripts/entry | 16 ---------------- scripts/getquote | 16 ---------------- scripts/mean | 27 --------------------------- scripts/profit | 2 -- scripts/reg | 14 -------------- scripts/report | 17 ----------------- scripts/spending | 8 -------- scripts/worth | 2 -- 10 files changed, 134 deletions(-) delete mode 100644 scripts/README delete mode 100755 scripts/bal delete mode 100755 scripts/entry delete mode 100755 scripts/getquote delete mode 100755 scripts/mean delete mode 100755 scripts/profit delete mode 100755 scripts/reg delete mode 100755 scripts/report delete mode 100755 scripts/spending delete mode 100755 scripts/worth (limited to 'scripts') diff --git a/scripts/README b/scripts/README deleted file mode 100644 index 7221f95f..00000000 --- a/scripts/README +++ /dev/null @@ -1,5 +0,0 @@ -This scripts are provided just in the way of giving ideas. They -probably all need to be modified to suit your particular environment. -Beware! - -John diff --git a/scripts/bal b/scripts/bal deleted file mode 100755 index 7fdf54ca..00000000 --- a/scripts/bal +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -switch="" -current="-c" -limit="-l \$50" -negonly="-N ^Liabilities" - -if [ "$1" = "-C" -o "$1" = "-U" -o "$1" = "-P" ]; then - switch="$1" - shift -elif [ "$1" = "-b" -o "$1" = "-e" ]; then - current="$1 $2" - shift 2 -fi - -accts="$@" -if [ -z "$accts" ]; then - accts="-Equity -Income -Expenses" - if [ ! "$switch" = "-P" ]; then - accts="$accts -Savings -Retirement" - fi -else - limit="" - negonly="" -fi - -ledger $current $limit $negonly -s $switch balance $accts diff --git a/scripts/entry b/scripts/entry deleted file mode 100755 index 28daf8c8..00000000 --- a/scripts/entry +++ /dev/null @@ -1,16 +0,0 @@ -#!/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 diff --git a/scripts/getquote b/scripts/getquote deleted file mode 100755 index cf8c8abd..00000000 --- a/scripts/getquote +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl - -exit 0 if $ARGV[0] eq "\$"; - -use Finance::Quote; - -$q = Finance::Quote->new; - -$q->timeout(60); -$q->require_labels(qw/price/); - -%quotes = $q->fetch("nasdaq", $ARGV[0]); - -if ($quotes{$ARGV[0], "price"}) { - print "\$", $quotes{$ARGV[0], "price"}, "\n"; -} diff --git a/scripts/mean b/scripts/mean deleted file mode 100755 index 3c6f779a..00000000 --- a/scripts/mean +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/perl - -$last = $ARGV[-1]; -splice(@ARGV, -1); - -open(PIPE, "ledger -MG @ARGV register $last |") || die; -@values = (); -while () { - ($date, $value) = split; - push @values, $value; -} -close(PIPE); - -@values = sort @values; -splice(@values, 0, 1); -splice(@values, -1); - -$value = 0.0; -for $item (@values) { - $value += $item; -} - -if (@values) { - printf("%.2f\n", $value / @values); -} else { - die "There are no values to average!\n"; -} diff --git a/scripts/profit b/scripts/profit deleted file mode 100755 index 26f112d1..00000000 --- a/scripts/profit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ledger "$@" balance ^Income$ ^Expenses$ diff --git a/scripts/reg b/scripts/reg deleted file mode 100755 index 75ac364e..00000000 --- a/scripts/reg +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -switch="-U" -current="-c" - -if [ "$1" = "-C" -o "$1" = "-U" -o "$1" = "-P" -o "$1" = "-M" ]; then - switch="$1" - shift -elif [ "$1" = "-b" -o "$1" = "-e" ]; then - current="$1 $2" - shift 2 -fi - -ledger $current -s $switch register "$@" diff --git a/scripts/report b/scripts/report deleted file mode 100755 index aa42982e..00000000 --- a/scripts/report +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -dir=$HOME/doc/finance - -cd /tmp - -ledger -M -G register "$@" > $1 - -gnuplot <