bannaN has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I would like to create a perlscript that executes a DB2 ddl file for initializing a database.
But the problem is that in order to do so (Script is runned by root) i have to do a source command.
source /home/db2inst1/sqllib/db2profile
How can i execute this inside a script, and make the script inherit this environment, so that commands later in the script issued with system will inherit this env?
if if run
But the problem is that in order to do so (Script is runned by root) i have to do a source command.
source /home/db2inst1/sqllib/db2profile
How can i execute this inside a script, and make the script inherit this environment, so that commands later in the script issued with system will inherit this env?
if if run
This will result in the following error 'Can't exec "source": No such file or directory' even though i can execute the same command directly in the shell.`source /home/db2inst1/sqllib/db2profile`;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Source command in perl script
by GrandFather (Saint) on Oct 20, 2011 at 08:26 UTC | |
by bannaN (Acolyte) on Oct 20, 2011 at 08:34 UTC | |
by roboticus (Chancellor) on Oct 20, 2011 at 09:48 UTC | |
Re: Source command in perl script
by Utilitarian (Vicar) on Oct 20, 2011 at 08:45 UTC | |
by bannaN (Acolyte) on Oct 20, 2011 at 09:08 UTC | |
by Utilitarian (Vicar) on Oct 20, 2011 at 09:32 UTC | |
by Anonymous Monk on Oct 20, 2011 at 10:00 UTC | |
Re: Source command in perl script
by pjcj (Novice) on Oct 20, 2011 at 13:19 UTC |
Back to
Seekers of Perl Wisdom