[Coco] [coco] Shell Scripts

George Ramsower georgeramsower at gmail.com
Mon Dec 17 23:07:19 EST 2007


----- Original Message ----- 
From: "George Ramsower"

> I've been trying to get a few OS9 commands to run in a shell script and 
> have
> found a few problems....
>
> One problem I'm having is trying to delete a directory.. I created a
> directory just for this example.
>
> Here's the result of a simple, one line shell script which reads as
> follows..
>
> OS9[T2]:list cmds/testdelete
> deldir /h0/test
>
>


 Thanks for all the input on this matter.
 A special hanks to Robert for Kildir. It did the trick!

 On the whole package I was working on, I realized tonight after trying  /.1 
and the other suggestions, I was forgetting <>>>/t2
 It's all about syntax, yes? Of course!

 So here's the working shell script..

OS9[T2]:list /h0/cmds/test
cd /h0/html
del inventory.txt
uloadx inventory.txt <>>>/t2
echo deleting the inventory directory
kildir www/inventory
echo creating the Inventory directory
makdir www/Inventory
dir    www
echo deleting inventory.lzh
del inventory.lzh
echo using MakeInventory
makeinventory
echo crunching the Inventory files
crunchinventory
echo Preparing to send the LZH file to you..
dloadx inventory.lzh <>>>/t2
echo Done

The makeinventory line is a B09 utility that takes a text file from Excel 
and saves each line(row) as an individual file in the Inventory directory.

The crunchinventory script contains only one line...

OS9[T2]:list /h0/cmds/crunchinventory
lha a -z /h0/html/inventory /h0/html/www/inventory/*

This makes a single file with all the files from the Inventory directory.

 The reason I had to do a seperate script for that one line is because LHA 
would read all the following lines in a script and try to add those to the 
file. I couldn't figure out how to make it stop crunching. I tried blank 
lines( only carriage returns) and it didn't work.

 Any ideas on how to make LHA stop reading lines after the desired stopping 
point?

George

Oh! By the way....


OS9[T2]: today
Today is Monday, December 17th.
It is the 351st day of 2007.
There are 14 days left in the year.
There are 8 shopping days left until Christmas.

*         Birthdays
*--------------------------------------------------------------------
     Arthur Fiedler
1778 Sir Humphry Davy, discovered several chemical elements
1903 Erskine Caldwell, Author
1926 Patrice Wymore
1929 William Safire, Political Columnist
1930 Julia Meade
*         Events
*-----------------------------------------------------------------------------
     Wright Brothers Day,
1538 Pope Paul III excommunicated England's King Henry VIII
1791 New York City traffic regulation creates the 1st one-way street
1792 Opening of first legislative assembly of Lower Canada
     in Quebec city
1843 Charles Dickens's classic: A Christmas Carol published
1903 At 10:35AM, for 12 seconds, 1st sustained motorized aircraft
     flight by Wright Brothers - 36 meters in Kitty Hawk N.C.
1933 1st professional football game: Chicago Bears vs. NY Giants.
1954 First fully automated railroad freight yard - Gary In.
1959 First motion picture opening simultaneously in major cities
     throughout the world - On The Beach 




More information about the Coco mailing list