Operating System - HP-UX
1758072 Members
2643 Online
108867 Solutions
New Discussion юеВ

Re: Use of variables with at and .proto

 
SOLVED
Go to solution
Jeff Poulton
Occasional Contributor

Use of variables with at and .proto

I have a program that submits 'at' commands to run other programs. For some reason some environment variables are not set in the at file.
As the environment variables change depending upon other variables I thought we could over come this by using veraibles in the /var/adm/cron/.proto file

Example: We have a variable INFORMIXDIR that changes with different environment.
INFORMIXDIR is used in other environment variables eg SHLIB_PATH
At the time of running the at command both the SHLIB_PATH and INFORMIXDIR are set, but it does not get set in the at file.
So I thought I would add the following to .proto
export SHLIB_PATH=${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql

Prolem: the $ signs get striped out and I end up with export SHLIB_PATH={INFORMIXDIR}/lib:{INFORMIXDIR}/lib/esql

Do any-one have a suggestion on how I can overcome my problem?

2 REPLIES 2
Ermin Borovac
Honored Contributor
Solution

Re: Use of variables with at and .proto

If variable is exported it should be present in the environment of your at job.

Anyway, you can try using double dollar ($$) in /var/adm/cron/.proto.

export SHLIB_PATH=$${INFORMIXDIR}/lib:$${INFORMIXDIR}/lib/esql
Jeff Poulton
Occasional Contributor

Re: Use of variables with at and .proto


The $$ solved the problem.

Thanks for that