Sheryl McKeown
2001-05-10 00:38:47 UTC
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?
Any ideas are appreciated!
Sheryl McKeown
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
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?
Any ideas are appreciated!
Sheryl McKeown
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/