Computing.Net > Forums > Unix > Changing shell in Korn script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Changing shell in Korn script

Reply to Message Icon

Name: Priya
Date: March 19, 2003 at 11:22:29 Pacific
OS: SunOS
CPU/Ram: -
Comment:

Hi,

I am trying to remotely run a korn script in a Linux box as a root user. However, the default shell in the Linux box for root is bash. I want to be able to change the shell from bash to ksh in my Korn script (without having to manually go and change the root's default shell), so that I don't have to worry about setting it everytime I use a new machine (as the script should take care of it).

I have searched and looked hard, but haven't been able to find a way that works. Can someone please help me out....

Thanks,
Priya.



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: March 19, 2003 at 13:01:21 Pacific
Reply:

The shell is declared on the first line of the script

#!/bin/ksh

#!/usr/bin/perl

etc


0

Response Number 2
Name: Priya
Date: March 26, 2003 at 16:06:02 Pacific
Reply:

Actually, David, I wanted to be able to exectue a ksh command on say, Linux, although Linux might not recognize the commnad. I figured it out and can make it work by using

ksh -c

example:-

hp uses remsh to log into another session. However, my script runs on Solaris and it doesn't recognize remsh. So, if in my script I say

ksh -c remsh -l .....

both Solaris and HP will be able to execute the command remsh.

Thanks for your answer, nevertheless...


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Changing shell in Korn script

mkdir in korn shell cgi script www.computing.net/answers/unix/mkdir-in-korn-shell-cgi-script/5347.html

Novice - change dir in shell script www.computing.net/answers/unix/novice-change-dir-in-shell-script/4762.html

Read in Korn Shell www.computing.net/answers/unix/read-in-korn-shell/5141.html