3 messages in com.perforce.perforce-user[p4] P4 environment variables and csh...
FromSent OnAttachments
Sheryl McKeown09 May 2001 17:38 
Stephen Vance09 May 2001 18:09 
Jeff A. Bowles09 May 2001 18:35 
Subject:[p4] P4 environment variables and csh or Perl
From:Sheryl McKeown (ibou@yahoo.com)
Date:05/09/2001 05:38:25 PM
List:com.perforce.perforce-user

Hello All,

I'm currently writing some scripts to centralize our p4 and p4d access. Currently we have a mixture of .csh and .pl scripts used to start and stop p4d, run checkpoints and do other admin tasks. I would like to consolidate these into some central scripts.

I need to use C Shell or Perl.

The current configuration is to either set the P4* variable in each and every script (which is a nightmare to keep updated) or to read it from the .cshrc.

I would like to set the P4* variables and some root directory variables in one script then 'include' these settings in all other scripts. But I can't seem to get that to work.

P4CONFIG is an option, but I want to set other variables we use in our admin tasks.

Ideally, I would like to "#include" a file into my current shell. However, I am hitting the limits of set and setenv of csh. (My hat for ksh and export!)

What I would like to do:

File include.csh: #!/bin/csh set P4TOP=/data1/perforce set P4ARCHIVE=/data1/perforce/journal/archives #and so on.

Calling file: #!/bin/csh ./include.csh #Now I have access to $P4TOP and $P4ARCHIVE #Go and do some stuff

Of course the problem I am having with csh is that the variables I set in include.csh are not being exported back to the calling shell.

How can I get around this in either csh or Perl?