SYSTEM command

Jean-Pierre A. Radley appl at jpr.com
Fri Nov 19 14:25:27 PST 2004


Steven Waters propounded (on Fri, Nov 19, 2004 at 12:54:17PM -0800):
| SCO UNIX 5.0.6 Filepro 5
| I am not sure if this can be done.
| I need to know when to purge a directory of files. 
| I use this at the command prompt;
| # l > list
| # wc -l < list
|   481

| I have 481 files in the directory. Lets say that when the directory
| reaches 500 I want Filepro to tell me to purge it.
| is it possible to get the result back , like a dummy field
| to your output processing system command?
| 
| I have removed the full path for this example;
| 
|   1
|          If:
|        Then: system "./bin/l /workorders > list"
|   2  -------   -   -   -   -   -   -   -   -   -   -  
|          If:   
|        Then: system "./bin/wc -l < /workorders/list"

You mean you are sitting in the root directory to do your work?  WHY?
Anyhow, you need but one system call and no intermediate 'list' (which I
suppose you also have polluting the root directory?)

	system "ls /workorders | wc -l "

| Is there a way to get the result of line 2 back into the processing?

Write a script called, say, /usr/local/bin/count, containing

	read where
	ls $where | wc -l

Then use this processing:

	::user count=/usr/local/bin/count:
	::count=/workorders  ' UGH!  Why is this directly under / ??
	::cc=count:
	::show "@"{cc ' or do something else based on cc:

-- 
JP


More information about the Filepro-list mailing list