Hello. We have recently changed from HP Unix Servers to Solaris. On the HP Severs we were using the POSIX shell. Solaris is using the Bourne sh.
We are using ksh as our default shell after login. The problem we are encountering is when something like Perl or Cron uses the shell to execute a command it is using bin/sh.
We have some perl scripts that run shell scripts inside of them. They are not working as they were designed for POSIX/KSH.
Is there anyway to make perl use a different shell when invoking shell scripting?
I will explain further....It's not calling a script.. Here is a line of code in the pearl script:
`sf_write_to_log`;
sf_write_to_log is a script located in another location that is set by the $PATH variable. sh for some reason doesn't use the $PATH and can't find the function.
I can test this by trying these commands at the command line:
> sh sf_write_to_log
sf_write_to_log: sf_write_to_log: cannot open
Cron does not normally run jobs within your normal environment. Try invoking the perl scripts through /usr/bin/env. That should pull the environment you normally have at the command prompt into the cron environment for that script.
E.g. if you have this in your crontab:
try instead:
You can then set $HOME, $PATH, $SHELL and anything else you need in your .profile
I think the problem is that our default shell is set to KSH and our $PATH is being set there. But perl is running any inline commands using SH. SH doesn't have the $PATH.
I am looking for a simple BASIC Interpreter written in a shell scripting language.
For me something like this would be a great learning tool...
After much goggle eyed Googling I came upon this:-
https://gist.github.com/cander/2785819
It is small and I haven't tried it yet as I am at work... (6 Replies)
Hi,
Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result.
perl interpreter info,
perl, v5.8.8 built for... (0 Replies)
Here is a puzzler.
To start, let me say that I've done a search on this issue and it is definitely not related to line endings being encoded in windows returns.
I get this error when I run SOME perl scripts. I have a script called hello_world.pl. I do $cp hello_world.pl new_hello_world.pl... (0 Replies)
I am trying to install net-snmp on an HPUX box. I am getting the fallowing error message when I try to run the snmpconf file. I installed the fallowing version of
net-snmp
net-snmp-5.0.10.2-HP-UX_B.11.11_9000_800.tar and my
HPUX box is version
HP-UX commnms B.11.11 U 9000/800... (2 Replies)
What would be the best way or method to determine or test for the shell interpreter at the beginning of a script in the event one shell is not available?
If I use the following:
#!/bin/bash
and /bin/bash is not available, then use I'd like to use /bin/ksh if it is available.
#!/bin/ksh (8 Replies)
What is the difference between the(a) shell and the (a) command-line interpreter?
Here we're talking about the complete dummy question, but could someone point me right.
(yes, have written scripts in for instance bash shell,
and and grepp-ed my way around ....:eek: (4 Replies)
Hello,
I am trying to accomplish the following.
Send the output of a command to the screen (this happens by default) as well as capture the output of the screen to a log file.
How can this be achieved in DOS command interpreter syntax.
Any ideas/suggesstions/indicators are greatly... (2 Replies)