.TH cashflow "" "" "/rdb Command" .PC "Compute balance column of cash table" \fBcashflow < \fIcashtable\fR .PP .II "compute cash flow" .II "cash flow" The command .B cashflow helps you manage your cash flow. It reads .IR cashtable , which you design, then computes a running balance in a .I Balance column (which must be column 3) from an .I Amount column (which must be column 2). .PP Cash-flow analysis lets you see if you will always have enough money in hand to cover each day's bills. It makes cash management possible by telling you whether to put off an expense until a check arrives, ask for an advance, get to work and make more money, or control your spending. .SH Example The following gives an example .IR cashtable , called .BR cash : .DM Date Amount Balance Description ------ ------ ------- ----------- 890101 512 current balance 890101 -450 rent check 890101 1000 pay check 890115 -300 estimated tax payment 890115 1000 pay check 890115 -1000 living expenses 890120 -900 big purchase .DE .DM 890201 1000 pay check 890201 -450 rent check 890215 1000 pay check 890115 -1000 living expenses .DE .PP The command .B cashflow needs two columns, named .B Amount and .B Balance. (If you use different column names, you must edit the .B cashflow shell script). All other columns are optional. Each row in your table represents a projected income item (positive) or a projected expense (negative). This is your flow of cash. To summarize the cash flow in our example table .BR cash , type: .DM cashflow < cash .DE .PP This prints the following on your screen: .DM Date Amount Balance Description ------ ------ ------- ----------- 890101 512 512 current balance 890101 -450 62 rent check 890101 1000 1062 pay check 890115 -300 762 estimated tax payment 890115 1000 1762 pay check 890115 -1000 762 living expenses 890120 -900 -138 big purchase .DE .DM 890201 1000 862 pay check 890201 -450 412 rent check 890215 1000 1412 pay check 890115 -1000 412 living expenses .DE .PP That .B "big purchase" gives us a negative balance in 890120. Now that you know, you can do something about it. One move is to put the big purchase off until the first of February. After you edit table .B cash to reflect this change, it appears as follows: .DM Date Amount Balance Description ------ ------ ------- ----------- 890101 512 current balance 890101 -450 rent check 890101 1000 pay check 890115 -300 estimated tax payment 890115 1000 pay check 890115 -1000 living expenses 890201 1000 pay check 890201 -900 big purchase 890201 -450 rent check 890215 1000 pay check 890115 -1000 living expenses .DE .PP Running .B cashflow again will tell us if this strategy works: .DM Date Amount Balance Description ------ ------ ------- ----------- 890101 512 512 current balance 890101 -450 62 rent check 890101 1000 1062 pay check 890115 -300 762 estimated tax payment 890115 1000 1762 pay check 890115 -1000 762 living expenses 890201 1000 1762 pay check 890201 -900 862 big purchase 890201 -450 412 rent check 890215 1000 1412 pay check 890115 -1000 412 living expenses .DE .PP As you can see, this works \(em there's no negative cash flow for any period. You can also try other options. .PP You can do all of the inputting and editing in the text editor. You can execute commands in .B vi by using the exclamation `!' shell feature; or from MicroEMACS by typing \fB!\fR. You also might want to write out to a .I tmp file and use .B mv to overwrite your .B cash table so that it is file is up to date. For example, in .B vi you can type: .DM :!cashflow < cashtable > tmp ; mv tmp cashtable :e! .DE .PP The first line computes the .B Balance column, writes the result into a .B tmp file, and moves .B tmp to be the new .B cashtable. All of this is necessary because in COHERENT you cannot have one file as both input and output without wiping out the file. The second line, .B :e! pulls the new file into the .B vi editor and displays it on your screen. .SH "See Also" COHERENT Lexicon: .B ksh, me, sh, vi .R .SO cashflow