Setting environment with a script

Discussion in 'Perl Misc' started by A. Farber, Mar 4, 2005.

  1. A. Farber

    A. Farber Guest

    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
     
    A. Farber, Mar 4, 2005
    #1
    1. Advertising

  2. 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.
     
    Brian McCauley, Mar 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JerryK
    Replies:
    2
    Views:
    582
    Ray Cassick \(Home\)
    Jan 29, 2004
  2. Rick Kasten

    Setting Environment Variables

    Rick Kasten, Jul 7, 2004, in forum: Perl
    Replies:
    2
    Views:
    598
    Howard
    Jul 7, 2004
  3. Replies:
    5
    Views:
    660
  4. Henry Hollenberg
    Replies:
    3
    Views:
    545
    Dennis Lee Bieber
    Feb 8, 2008
  5. J. Romano
    Replies:
    5
    Views:
    1,500
    Darren Dunham
    Jul 7, 2004
Loading...

Share This Page