General discussion

Locked

Solaris 7 default shell problem

By wiaia ·
I have a script that requires a specific k shell only expression to execute. The script runs correctly on an E6500 running Solaris 7, but fails on two E3500s running Solaris 7. We have already checked with diff, and the scripts are identical on the 3 machines. Patch levels are also identical.

We turned on additional debugging and it shows that even though the first line of the script is #!/bin/ksh at the instant the expression is supposed to run, the system shell is /bin/sh. Of course this makes the script fail because the expression is k shell exclusive.

Does anyone have an idea about how to fix this problem?

Thanks,

George Wolfe
Systems Engineer
First Data Corp.

This conversation is currently closed to new comments.

10 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Solaris 7 default shell problem

by wiaia In reply to Solaris 7 default shell p ...

This only happens when cron runs the script.

Collapse -

Solaris 7 default shell problem

by wiaia In reply to Solaris 7 default shell p ...

Point value changed by question poster.

Collapse -

Solaris 7 default shell problem

by insatiable In reply to Solaris 7 default shell p ...

Some simple places to start.... but... ya never know!
Is there a /bin/ksh ??
I didn't think it was necessary, but /etc/shells might have to have /bin/ksh for a script to execute it.
And, just in case, have you checked the perms on the folder/files the script is trying to use?
Is the PATH setup like the system that works?
Does it give you any error at all when it quits running?
Good luck -- write back if you have answers and still need help!
Melissa

Collapse -

Solaris 7 default shell problem

by wiaia In reply to Solaris 7 default shell p ...

I had alread checkedc all of these things.

Collapse -

Solaris 7 default shell problem

by cpfeiffe In reply to Solaris 7 default shell p ...

The system shell will remain the same throughout execution of your script. The only thing that will be done in ksh are the functions in the script. If you use ps you will see something like ksh -c script. All of the functions within the script will similiarly be ksh -c function. Yet env will return SHELL=/bin/sh. That is OK. How commons is this ksh expression? Is it something that might not be available in two different versions of ksh? Make sure you have the same rev and version for Solaris 7 and ksh on all machines. Hardware shouldn't matter. /etc/shells is not needed as long as /bin/ksh and all its libraries exist (try to go to ksh manually and run this command). Does ksh work at all? Checking your paths and file permissionsas Melissa suggested is a good place to start.

Good luck,
Charles

Collapse -

Solaris 7 default shell problem

by wiaia In reply to Solaris 7 default shell p ...

I had already checked all of these things

Collapse -

Solaris 7 default shell problem

by pVp In reply to Solaris 7 default shell p ...

Thanks for the hint!

cron only *ever* runs stuff under sh.

Try making your crontab entry:

/bin/ksh <name of your script>

Collapse -

Solaris 7 default shell problem

by pVp In reply to Solaris 7 default shell p ...

Check the syntax! I usually spout ideas, but don't pay much heed to syntax when spouting :)

Collapse -

Solaris 7 default shell problem

by wiaia In reply to Solaris 7 default shell p ...

Actually, I found the problem myself, but your answer was more on target, if that had been the real issue. Actually, there was an incorrect version of a tool the script uses on 2 of the systems.

Collapse -

Solaris 7 default shell problem

by wiaia In reply to Solaris 7 default shell p ...

This question was closed by the author

Back to Linux Forum
10 total posts (Page 1 of 1)  

Related Discussions

Related Forums