Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Setting environment with a script

Reply
Thread Tools

Setting environment with a script

 
 
A. Farber
Guest
Posts: n/a
 
      03-04-2005
Hi,

I have a question not related to Perl's syntax, but to its usage.

I have a script which generates GNU Makefiles out of a bigger
number of input files. With that script I'd also like to
set environment variables for a build - so that I have one
big all-in-one script.

With Unix that's easy - I'll let the users call my script as

eval `create_makefiles.pl` in sh
and
eval `create_makefiles.pl -c` in csh

and generate export/setenv commands when called this way.

But what could I do to make it also work on Windows?
(in a DOS-window, not in Cygwin) Does anybody solve this
problem already or knows a module doing similar things?

Thanks
Alex
 
Reply With Quote
 
 
 
 
Brian McCauley
Guest
Posts: n/a
 
      03-04-2005
A. Farber wrote:

> I have a question not related to Perl's syntax, but to its usage.


You've almost partitioned the problem but you've just stopped one step
short. You problem is about the ways processes can interact under
windows - the fact that one or more of the script is in Perl is not
relevant.

> With Unix that's easy - I'll let the users call my script as
>
> eval `create_makefiles.pl` in sh
> and
> eval `create_makefiles.pl -c` in csh
>
> and generate export/setenv commands when called this way.
>
> But what could I do to make it also work on Windows?


You can have the Perl script create a batch file the call that batch
file. There may be better ways but this is really a question about
Windows not Perl so perhaps you should ask in a Windows newsgroup.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? PerlFAQ Server Perl Misc 0 03-12-2011 11:00 AM
Setting up a new user and environment from within a python script Henry Hollenberg Python 3 02-08-2008 07:23 AM
70-284 Lab Environment, Need Virtual Environment brooklynbridge508@hotmail.com MCSA 4 05-02-2007 09:49 AM
Setting an environment variable from another environment variable marcwentink@hotmail.com Java 5 04-04-2007 10:39 PM
Setting environment variables from a Perl script J. Romano Perl Misc 5 07-07-2004 04:07 PM



Advertisments