Changing from bash to ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Changing from bash to ksh
# 1  
Old 01-28-2019
Changing from bash to ksh

Hello,

I want to run a script written in ksh but my default shell is bash as root e.g in the script it has #!/bin/ksh
i have gone into /etc/passwd to change it from :/bin/bash to /bin/ksh
but still giving me an error when running scripts such as
Code:
  ./installer
-bash: ./installer: /bin/ksh: bad interpreter: No such file or directory

# 2  
Old 01-28-2019
try searching for a interpreter
Code:
which ksh

# 3  
Old 01-28-2019
If you don't have ksh, the natural thing to do would be to install it using whatever package manager is traditional for your OS and distribution.
# 4  
Old 01-29-2019
Or an interesting exercise would be to convert your script to run on bourne shell, so that it works on all shells. Would be quite insightful to do so Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing IFS in bash function

I have a function in bash that takes arguments. does IFS work in a function or does it apply only to the main script? (1 Reply)
Discussion started by: kristinu
1 Replies

2. Shell Programming and Scripting

Bash - changing a color of a substring

Hello! I need to write a bash script for my university classes, and I came up with an idea of a program that would test the speed of typing - there is some random text that you have to rewrite, and the script measures time, number of mistakes etc. The text would be visible on the screen all... (3 Replies)
Discussion started by: xqwzts
3 Replies

3. Shell Programming and Scripting

Changing the scroll limit in ksh

I don't have my SysV bible with me currently and I can't remember how to change the amount of lines visible in my shell. Currently I can only scroll back to see the last 100 lines of stdout. Any help is greatly appreciated. blessings, Tony <>< (2 Replies)
Discussion started by: port43
2 Replies

4. Shell Programming and Scripting

bash changing file name

I want to run some unix commands on one file..let say if i change the name and that name of file is present already. I dnt want to change that presnt file but instead of that make another one with different name eg.. usa.txt if it is there make usa.txt.1 something like that Also one more... (5 Replies)
Discussion started by: Learnerabc
5 Replies

5. Shell Programming and Scripting

Changing text colour in bash

I am doing a basic script to check if services are disabled, and I was wondering how to change to colours for PASS and FAIL to green & red respectively. #!/usr/bin/bash clear TELNET=`svcs -a | grep telnet | awk '{print $1}'` if then RESULT=PASS else RESULT=FAIL fi... (3 Replies)
Discussion started by: detatchedd
3 Replies

6. UNIX for Dummies Questions & Answers

bash preferred or ksh with bash features

I'm a user on a fairly locked down sys V server. By default, I have ksh set as my default shell. I added to my .profile: bash -o vi so when I login, it goes into bash so I can take advantage of tab completion and use the up key to bring up previous commands. However, whenever I want to exit, I... (2 Replies)
Discussion started by: mrwatkin
2 Replies

7. Shell Programming and Scripting

display changing variable in one place on screen in ksh

Is it possible using just korn shell script to display a variable on the screen that is constantly changing in on place on the screen, to tell it in coordinates or something? In a loop, echo will print a new line each time, can I make it a static position? Thanks (7 Replies)
Discussion started by: raidzero
7 Replies

8. UNIX for Advanced & Expert Users

changing shell type from sh to ksh

Could someone please advise, what's the best way to changing the shell type from sh to ksh. When I login into a unix server it takes you directly to sh, is there a way of amending the .profile to use ksh instead. Or is there some other way ? Ideally it would be good to be done from the login... (10 Replies)
Discussion started by: venhart
10 Replies

9. Shell Programming and Scripting

bash and ksh: variable lost in loop in bash?

Hi, I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh). The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies

10. UNIX for Dummies Questions & Answers

Need help with changing bash to perl

Hi guys, I am converting a bash script to perl. I need lots of help and pointers on how to make the script work. Any help would be greatly appreciated. Here is what I have: #!/usr/bin/perl #Decrypt Files $dir = "/usr/bin/gpg; opendir(PGP_DIR, $dir) || die "can't opendir $dir: $!";... (3 Replies)
Discussion started by: freak
3 Replies
Login or Register to Ask a Question