peschkaj has asked for the wisdom of the Perl Monks concerning the following question:
Can't exec ". /opt/lnpsite/nm02/scripts/setup_env": No such file or di +rectory at ./opSet.pl line 27, <STDIN> line 1. Cannot execute . /opt/lnpsite/nm02/scripts/setup_env: No such file or +directory
#!/opt/perl5/bin/perl -w use strict; my @instances; my $i = 1; my $selection = 0; opendir OPHOME, "/opt/lnpsite" or die "Can't open /opt/lnpsite: $!\n"; my @files = sort(readdir(OPHOME)); foreach(@files){ if (m/(op|nm)\d{2}$/) { push(@instances, $_); } } print "\nAvailable Instances"; print "\n===================\n"; foreach(@instances) { print " $i. ",$_,"\n"; $i++; } print "\nSelect an instance and press enter: "; $selection = <STDIN>; chomp($selection); $selection = $selection - 1; my $conn = ". /opt/lnpsite/" . $instances[$selection] . "/scripts/setu +p_env"; print "$conn\n"; exec $conn $instances[$selection] or die "Cannot execute $conn: $!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unexpected die
by sauoq (Abbot) on Aug 08, 2002 at 19:34 UTC | |
by peschkaj (Pilgrim) on Aug 09, 2002 at 02:41 UTC | |
by graff (Chancellor) on Aug 09, 2002 at 04:28 UTC | |
by sauoq (Abbot) on Aug 09, 2002 at 03:20 UTC | |
|
Re: Unexpected die
by DamnDirtyApe (Curate) on Aug 08, 2002 at 19:10 UTC | |
by graff (Chancellor) on Aug 09, 2002 at 02:25 UTC |