Qualifiers

Brian K. White brian at aljex.com
Thu Dec 3 14:01:24 PST 2009


frank7767 at aol.com wrote:
>  I am in adding 5 qualifiers to an existing Filepro system....The 
> process of adding them is very tedious.
> is there a way to add these qualifiers to all the filepro files via a 
> script or any other way?
>  
> Regards
> Frank Gemeinhardt

We (and you at least on one box) have a script that copies one qualifier 
to another, and we use that to create new qualifiers by specifying 
unqualified as the source qualifier. On our systems nowadays we treat 
the unqualified dataset as a special case that is mostly empty except 
for a few things that are meant to be common between all qualifiers.

Look on fg1.aljex.com at /u/aljex/bin/cpq

I does have a requirement that you have what we call a company start 
script to provide the initial environment. That tells cpq what directory 
to work in and what qualifier to copy.

If you are doing this on fg1 then you would do this:
If the filepro directory you are working in is, say, /u/gempro
, first make a company start-script that define the unqualified dataset 
in /u/gempro

In fact, I already had exactly such a system set up for you:
/u/aljex/start/gempro:
------------------------------
#!/bin/bash
. fpini

COMPANY=gempro
PFNAME="Gemeinhart Produce System ($TTY)"
PFDIR=/u/gempro/appl

. fprun
------------------------------


A lot of magic happens in .fpini and .fprun so that this is all you need 
for most start scripts. For a normal company environment there would be 
one more line here PFQUAL=something

So, for you, if you wanted to create 5 new qualifiers in the gempro 
system, you would just enter the gempro unqualified system and run 5 cpq 
commands.

gempro
cpq aaa
cpq bbb
cpq ccc
cpq ddd
cpq eee
exit

Then, assuming the qualifiers are to be used as datasets for different 
customers, create 5 matching start-scripts for them. You could copy 
gempro to 5 new names and then edit them. The new scripts would look 
like this:

/u/aljex/start/aaa:
------------------------------
#!/bin/bash
. fpini

COMPANY=aaa
PFNAME="AAA System ($TTY)"
PFQUAL=aaa
PFDIR=/u/gempro/appl

. fprun
------------------------------

[...]

/u/aljex/start/eee:
------------------------------
#!/bin/bash
. fpini

COMPANY=eee
PFNAME="EEE System ($TTY)"
PFQUAL=eee
PFDIR=/u/gempro/appl

. fprun
------------------------------

Then to do work in these systems you run the matching start-script.
for instance bbb, or "bbb p"

To make a user only ever work in their system you put put the start 
script and a starting menu in their .profile

/home/aaauser1/.profile :
[...]
exec aaa p main

Otherwise feel free to look at what cpq does and make a version that 
does what you want. It's about what Ken described in his post.

Attached is the script for everyone else. Taken out of the context of 
Aljex boxes, you could get rid of the $COMPANY test line and get the 
necessary working directory and source qualifier ($DD and $SQ near the 
top) some other way like ask the user or more cmdline args.

This could all be done directly in filepro too, except for chmod/chown I 
guess, but you could just run setperms as a separate step afterwards to 
take care of that.

In the help wherever it says to run "company cpq ..."
Our environment start-scripts are designed to be used two ways.
You can run a single command in a given environment by running "company 
command ..." or you may just run "company" with no args and you are put 
into a new child shell in that environment. Actually there is a 3rd 
usage, you can run ". company :" which loads up your current shell with 
that environment. That's useful in cron jobs and cgi and a few other cases.
So it just means either run a compnay start-script in the command in 
place of the word company, like:
gempro cpq aaa
or already be in the environment you want to clone, by having run the 
scrip with no arguments sometime before. That's what my directions above do.
gempro
# now we are in the gempro environment
# which just means that
# COMPANY=gempro
# PFDATA=""
# PFDIR=/u/gempro
# PFQUAL=""
cpq aaa
cpq bbb
etc...

-- 
bkw

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cpq
Url: http://mailman.celestial.com/pipermail/filepro-list/attachments/20091203/7b079e64/attachment.pl 


More information about the Filepro-list mailing list