How to source variables and values from a file, like in UNIX sh scripts?
From: Ronnie Laurikkala (ronnie.laurikkala_at_ericsson.com)
Date: 12/18/03
- Next message: Jürgen Exner: "Re: autoincrement strangeness - please help!"
- Previous message: Munnki: "autoincrement strangeness - please help!"
- Next in thread: Jürgen Exner: "Re: How to source variables and values from a file, like in UNIX sh scripts?"
- Reply: Jürgen Exner: "Re: How to source variables and values from a file, like in UNIX sh scripts?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Dec 2003 11:21:43 +0100
In e.g. a Bourne shell script I can source variables and values;
#!/bin/sh
. ${HOME}/script_common_lib
How can I source variables and values from a file
and use them in Perl-scripts?
Perl-"pseudo code":
...
source("${HOME}/script_common_lib");
$logfile = $A_LOG_FILE;
...
print "Log file name: ", $logfile;
...
And in the file '${HOME}/script_common_lib' contains e.g.:
...
export A_LOG_FILE=/tmp/foo.log
...
Best Regards,
Ronnie
- Next message: Jürgen Exner: "Re: autoincrement strangeness - please help!"
- Previous message: Munnki: "autoincrement strangeness - please help!"
- Next in thread: Jürgen Exner: "Re: How to source variables and values from a file, like in UNIX sh scripts?"
- Reply: Jürgen Exner: "Re: How to source variables and values from a file, like in UNIX sh scripts?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]