Problems Running KSH on Solaris 10


 
Thread Tools Search this Thread
Operating Systems Solaris Problems Running KSH on Solaris 10
# 1  
Old 09-10-2010
Problems Running KSH on Solaris 10

Hi,

I am currently in the process of testing upgrading from Solaris 8 to Solaris 10.
one problem i have encountered is when i am running any of my batch scripts.
All my scripts start with #! /bin/ksh so that they will excuted in the ksh shell.
but the scripts will not run correctly. The enviroment varibales are

Code:
$ env
_=/usr/bin/env
HZ=
LC_MONETARY=en_IE.ISO8859-15
LC_TIME=en_IE.ISO8859-15
PATH=/usr/bin::/usr/local/bin
LOGNAME=batchusr
MAIL=/var/mail/batchusr
LC_MESSAGES=C
LC_CTYPE=en_IE.ISO8859-15
CVSROOT=:pserver:batchusr@unixprod1:2401/export/home/cvsroot/batchusrPublicScripts
SHELL=/usr/bin/pfksh
HOME=/export/home/batchusr
LC_COLLATE=en_IE.ISO8859-15
LC_NUMERIC=en_IE.ISO8859-15
TERM=xterm
PWD=/export/home/batchusr
TZ=Eire

As you can see i am using the pfksh as my default shell, This is the same as on my solaris 8 box.

How can i get my ksh scripts to run correctly on the pfksh shell, should i change my deafult shell?

Moderator's Comments:
Mod Comment Use code tags please.


---------- Post updated at 06:52 AM ---------- Previous update was at 05:59 AM ----------

after further investigation, it appears that there is a difference between the ksh on solaris 8 and Solaris 10. i copied the ksh from 8 to 10 and the scripts run fine. put back the original ksh and the scripts stop working.
so something has changed in the ksh between 8 and 10.
# 2  
Old 09-10-2010
It would help if you tell what precisely fails in your scripts.
# 3  
Old 09-13-2010
Quote:
Originally Posted by jlliagre
It would help if you tell what precisely fails in your scripts.

the problem with the script is that it can not see the common functions, when the script run the commonfunctions are put into the env.

Code:
. /export/home/batchusr/bin/commonfucntions

the ksh is not doing this, its like its similar to sh
# 4  
Old 09-13-2010
Solaris 10 ksh is seeing functions defined in a sourced file by design. There must be something specific in your set-up. Can you post a reproducible real example of different behavior observed between Solaris 8 and 10 ksh ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems running scripts in the background

Hi Could someone offer some help on this problem I've got with running a background process. As part of a script that does a stop/start/status for a piece of software called SAS, the following extract is from part of the start step. My issue is that when the script is run, the control... (0 Replies)
Discussion started by: GavP
0 Replies

2. UNIX for Dummies Questions & Answers

Running into problems while spoofing IP Address

I have a machine (IP:192.168.1.185) and i want to send spoofed IP address (e.g. 192.168.1.212) to another machine(192.168.1.213) . I am using a spoofing program for this which uses raw sockets. Now whenever i pass the parameters(spoofed ip addr and destination) to the output of the program, i... (2 Replies)
Discussion started by: syncmaster
2 Replies

3. Shell Programming and Scripting

problems with ksh array and find command

set -A allfiles `find $usrhtml -type f` i am trying to populate this array with the find command. It works fine when find is looking through a single directory but when i add a new subdirectory the files in the subdirectory get duplicated. Can anyone help me and fix this so each files in... (1 Reply)
Discussion started by: bjhum33
1 Replies

4. Shell Programming and Scripting

Problems with ksh

I have the following ksh code and I am passing f="npt06-sr40-syn-dc0p02-32x24drw.mis" For some reason, it's going to the else statement instead of setting optfdrw=1 smptag=$(print -R $f | awk '/smp/') drwtag=$(print -R $f | awk '/drw/') if && ; then # drw tag... (15 Replies)
Discussion started by: kristinu
15 Replies

5. Shell Programming and Scripting

Problems running script in cron...

Hi all, I have a script running on a Solaris 8 box and the first thing it does it check which user is executing it; if ; then echo "This script must be run as testuser" 1>&2 exit 1 fi This works fine when manually running the script however when adding into that users' crontab it... (1 Reply)
Discussion started by: JayC89
1 Replies

6. Red Hat

Problems with script running with crontab

Hi, I'm trying the backup a few information commands of my Check Point FW (it's on a SPLAT linux machine). This is the script I wrote: #!/bin/bash cd /var/tmp/ file1=netstat_`/bin/date +%d%m%y`.txt file2=ifconfig_`/bin/date +%d%m%y`.txt file3=cpstatos_`/bin/date +%d%m%y`.txt... (2 Replies)
Discussion started by: nirsh
2 Replies

7. Shell Programming and Scripting

autosys/ksh - problems with script

Hi, I'm using autosys and want to set it up that I receive emails when certain jobs start and finish. I don't want to edit each jobs script (ksh) to send a mail at start and finish, I would rather have a single script/job that watches for a trigger when the jobs have started or finished. I... (1 Reply)
Discussion started by: weszardoz
1 Replies

8. Shell Programming and Scripting

Strange parameter passing problems (KSH)

Hi all, I'm having a rather peculiar problem involving parameter passing with declared functions in my shell script. Hope to get some advice here. A brief description of my code is as follows: However, I'm not getting the results I wanted. If I pass in $rdir, I'm going to end up... (4 Replies)
Discussion started by: rockysfr
4 Replies

9. UNIX for Dummies Questions & Answers

Running Script from Telnet - Problems

...so I read "The Pragmatic Programmer" and they stressed the value of learning shell scripting! I'm in a UNIX environment but have a Windows XP workstation. I'm using Telnet to issue UNIX commands. I've done plenty of chmod's, command line ftp and stuff, but written no scripts to this point.... (1 Reply)
Discussion started by: pauljohn
1 Replies

10. UNIX for Dummies Questions & Answers

having ksh script problems

well i have written a script to telnet and ftp to all my servers, the script runs great, BUT i can not for the life of me figure out how to get the script to repeat if the conditions are not filled. this is what i have so far ######################################### TorF(){ echo T... (4 Replies)
Discussion started by: jerzey4life
4 Replies
Login or Register to Ask a Question