Issues with ksh


 
Thread Tools Search this Thread
Operating Systems Linux Issues with ksh
# 1  
Old 10-17-2013
Issues with ksh

We are using ksh on Linux (Thats what architect told me).
1) When I am using up and down arrow key, I can not navigate to previous and next commands. How can I navigate commands in ksh ? Someone told me that I need to have bash shell installed ? Can I have bash shell installed on ksh ? OR can I have both ksh and bash shell installed ? How can I switch between shells , if I have more than 1 shells installed ?

2) I was running some command and it stopped giving me command line. Whatever key I press, it will literally be typed on line. Q, Esc, ctrl+q nothing would work to abort. If I want to abort some command OR quit a command, how can I do that ?

3) Why are there so many shells in Linux environment ? Is there an advantage of using one over the other ? Whats the advantage of using ksh over bash shell ?

4) Are thgere any updates coming to these shells like ones for browsers and OS ? If yes, how can we find that out ?

Thanks
# 2  
Old 10-17-2013
1) When I am using up and down arrow key, I can not navigate to previous and next commands. How can I navigate commands in ksh ? Someone told me that I need to have bash shell installed ? Can I have bash shell installed on ksh ? OR can I have both ksh and bash shell installed ? How can I switch between shells , if I have more than 1 shells installed ?

That functionality is available in newer versions (takes some tweaking though) of ksh (i.e. ksh93). If you're more comfortable using that functionality then switch to bash. Both shells are usually available on the average Linux system.
If you want to see what shell you're currently using run this command:
ps -p $$ | awk 'END{print $NF}'

If you want to switch between shells, use the chsh command (if available):
chsh -s $(which <shell name here>)

Afterwards you would need to logout and log back in to enable the new shell.


2) I was running some command and it stopped giving me command line. Whatever key I press, it will literally be typed on line. Q, Esc, ctrl+q nothing would work to abort. If I want to abort some command OR quit a command, how can I do that ?

I didn't see CTRL-C listed. If that doesn't work, try CTRL-Z to pause\stop the process (should return you to the shell). Then run jobs -l to list it and then feed the PID to the kill command.

3) Why are there so many shells in Linux environment ? Is there an advantage of using one over the other ? Whats the advantage of using ksh over bash shell ?

Nothing wrong with a wide selection. Everyone has different needs and/or uses and most shells are very unique unto themselves. I personally like both, but bash has the advantage of being easier, especially for those new to Unix\Linux.

4) Are thgere any updates coming to these shells like ones for browsers and OS ? If yes, how can we find that out ?

Google the shells and visit their websites. They should list their software release cycle.

Ok, my lunch break is over. Hope I answered your questions. Smilie

Last edited by in2nix4life; 10-17-2013 at 01:47 PM..
# 3  
Old 10-17-2013
You can find out which shells you have installed by running the following command:
Code:
gacanepa@debian:~$ cat /etc/shells
# /etc/shells: valid login shells
/bin/csh
/bin/sh
/usr/bin/es
/usr/bin/ksh
/bin/ksh
/usr/bin/rc
/usr/bin/tcsh
/bin/tcsh
/usr/bin/esh
/bin/dash
/bin/bash
/bin/rbash
gacanepa@debian:~$

You can display your current shell by echoing the SHELL environment variable:
Code:
gacanepa@debian:~$ echo $SHELL
/bin/bash
gacanepa@debian:~$

Hope it helps.
# 4  
Old 10-17-2013
In addition to what in2nix4life has already said, here are a few additional comments:
Why do I prefer ksh over bash?: Recent versions of the Korn shell can perform floating point calculations directly in the shell in addition to integer calculations (bash does not). The Korn shell frequently runs shell scripts faster than bash. I've been using it for more than 30 years and it "feels" natural to me. And, I personally know Dr. David Korn.

All versions of the Korn shell support command history, but the default mode may be different for bash than it is for ksh. The Korn shell defaults to vi mode command line editing; I think bash defaults to emacs mode. If you want ksh to use emacs mode, issue the command:
Code:
set -o emacs

after you start ksh (or do it in one of your shell's startup initialization files).

Note that many systems have more than one version of an emacs-like editor. Your shell may offer other choices. (On Mac OS X, ksh provides vi, emacs, and gmacs editing modes.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sendmail issues

Hi, I'm having some problems with sendmail in Linux. The thing is when I type the following command to send an e-mail: sendmail bartoszk@companydomain.pl< test.txt it looks like it executed but I don't receive the mail. The file test.txt looks like that: To:... (3 Replies)
Discussion started by: bartoszk
3 Replies

2. HP-UX

HPUX KSH for loop issues.

Wrote a KSH script on a RHEL server and moved it over to the HPUX server and it is not liking a loop that I put together. Here is the simple form of it that does not work in KSH: for x in {0..$VARIABLE_NAME} do echo $x done This works: for x in {0..10} do echo $x ... (3 Replies)
Discussion started by: jake0391
3 Replies

3. Emergency UNIX and Linux Support

rm -rf issues

We are using the solaris server and if i am using rm -rf to delete the directories its asking the confirmation for each and every file inside the directory.Is there any way to disable ( should not ask the confirmation) only for a particular session? (12 Replies)
Discussion started by: sureshbabuc
12 Replies

4. Shell Programming and Scripting

different behaviour for ksh and ksh -x

I'm getting different behaviour when executing below script in debug option. $ cat ss.ksh ff=$(pwd) echo " ff : $ff" $ ksh ss.ksh ff : /tmp $ ksh -x ss.ksh + + pwd ff= + echo ff : ff : I was getting this behaviour in my actuall script i'm able to reproduce this in simple script... (4 Replies)
Discussion started by: luckybalaji
4 Replies

5. UNIX for Dummies Questions & Answers

Difference Between executing llike ./myscript.ksh and . ./myscript.ksh

Hi , What is the diffence between executing the script like ./myscript.ksh . ./myscript.ksh I have found 2 difference but could not find the reason 1. If i export a variable in myscript.ksh and execute it like . ./myscript.ksh the i can access the other scripts that are present in... (5 Replies)
Discussion started by: max_hammer
5 Replies

6. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

7. UNIX for Advanced & Expert Users

KSH Login issues

Hi In my environment User have csh have default shell. In some cases some users requires KSH. We are using NIS as well as some local users. here my problem is recently in some of sun servers if users who have ksh as a default shell are trying to login with putty the session terminated after... (3 Replies)
Discussion started by: vkesineni
3 Replies

8. Shell Programming and Scripting

KSH script -text file processing NULL issues

I'm trying to strip any garbage that may be at the end of my text file and that part is working. The problem only seems to be with the really long lines in the file. When the head command is executed I am directing the output to a new file. The new file always get a null in the 4096 position but... (2 Replies)
Discussion started by: geauxsaints
2 Replies

9. Shell Programming and Scripting

import var and function from ksh script to another ksh script

Ih all, i have multiples ksh scripts for crontab's unix jobs they all have same variables declarations and some similar functions i would have a only single script file to declare my variables, like: var1= "aaa" var2= "bbb" var3= "ccc" ... function ab { ...} function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies

10. Shell Programming and Scripting

SU issues

Hi, I have automated a build process that does the following activities. 1. check out code from cvs to a specific directory 2. build the revision checked out with 'ANT' 3. integrate the compiled code with the QA/UAT or new environment (/apps/QA or /apps/UAT or /apps/new directory) I... (1 Reply)
Discussion started by: yoi2hot4ya
1 Replies
Login or Register to Ask a Question