Can anybody point me in the right direction here. I can execute the following commands just fine from the C shell but cannot run them from a perl script. I get the following error message:
perl export.pl
echo: No such file or directory.
status3 went wrong:256 at export.pl line 24.
The third command relies on the first two commands to set $data_root. When I run echo $data_root from the shell after running the script I get:
data_root: Undefined variable.
Thank you so much for your help.
#! /usr/bin/perl
$program = "/bin/csh ";
$status1 = system("$program source /exlibris/aleph/a16_1/aleph/proc/un
+set_lib_env");
die "status1 went wrong:$?" unless $status1 ==0;
$status2 = system("$program source `/exlibris/aleph/a16_1/aleph/exe/de
+v_aleph gpo01`/gpo01/prof_library");
die "status2 went wrong:$?" unless $status2 ==0;
$status3 = system("$program echo $data_root");
die "status3 went wrong:$?" unless $status3 ==0;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.