Visit Our UNIX and Linux User Community


Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Shells
# 1  
Old 10-09-2012

Lets say my default shell is bash and then i load up csh and then ksh. How would i exit csh without exiting ksh?

so basically i gone from bash > csh > ksh and i wish to close csh
# 2  
Old 10-09-2012
Closing csh will terminate ksh.
kill -9 $PPID

Last edited by rdrtx1; 10-09-2012 at 06:45 PM..
# 3  
Old 10-10-2012
Originally Posted by Bill Thompson
Lets say my default shell is bash and then i load up csh and then ksh. How would i exit csh without exiting ksh?

so basically i gone from bash > csh > ksh and i wish to close csh
In one word (well, two actually): you can't. You can't, because processes are organized like a tree. When you cut off a branch all the leaves on this branch are cut off too.

That means: you can exit the "csh" any way you want (sending it a KILL signal like was mentioned before is one way), but you will always exit the ksh too when you do so. The only way to circumvent this is to start the ksh in the background using "nohup". This will make the "leaf" to be its own branch starting from the main trunk (process "init") and hence leave it when you kill csh. You can not access this ksh directly any more, though, because it is not attached to any terminal any more. (This is fine for scripts writing to files, also for background processes, but will render interactive programs unusable.)

I hope this helps.

This User Gave Thanks to bakunin For This Post:

Previous Thread | Next Thread
Test Your Knowledge in Computers #880
Difficulty: Medium
SCADA systems that tie together decentralized facilities such as power, oil, gas pipelines, water distribution and wastewater collection systems were designed to be open, robust, easily operated and repaired, and highly secure.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Please what are shells?

I mean like this: Can anyone explain how this works? I hope my post is not spam. I think its related to linux. Thank you (1 Reply)
Discussion started by: postcd
1 Replies

2. UNIX for Dummies Questions & Answers

Significance of different shells?

I'm taking a LINUX and UNIX class and we are using bash as the shell in terminal. On my mac-book I use zsh only because my professor had a pretty cool start-up file for it. It has benefited me in becoming familiar with different shells. However, I'm having a hard time understanding the purpose... (4 Replies)
Discussion started by: syregnar86
4 Replies

3. Shell Programming and Scripting

Difference between shells

ple tell me What is the diff between ksh,sh,bash and csh (1 Reply)
Discussion started by: Boby120677
1 Replies

4. Shell Programming and Scripting

Differences between shells

What is the practical difference among the different shell like csh , ksh , bash etc.:confused::confused: Please use descriptive subjects instead of single words (2 Replies)
Discussion started by: hiten.r.chauhan
2 Replies

5. Shell Programming and Scripting

find all of the available shells

To find all of the available shells in your system we can use cat /etc/shells but i dont find shells in my system where else i can look for same info?? (4 Replies)
Discussion started by: Deepak Dutt
4 Replies

6. UNIX for Advanced & Expert Users

why we have different shells?

Can you pls. tell me, why we have different shells in UNIX OS ( Eg. SunOs) and also I would like to know what is the specific difference b/w SVR and BSD ? Thanks. (2 Replies)
Discussion started by: shahnazurs
2 Replies

7. UNIX for Dummies Questions & Answers

pipes and shells

Hi How do I direct the output from ls to for example grep a in C. I am not asking for the whole shell implementation. If I write ls|grep myfile in the shell. How is the output sent from ls to the input grep. whit int pipe(pipe); We create the pipe. I and I guess we use dup2(old... (4 Replies)
Discussion started by: isato
4 Replies

8. Shell Programming and Scripting

control sub-shells

Hi all, New to shell scripting, I would like to know if it is possible to pass commands to a shell, which has been launched by a parent shell. Example: #!/bin/ksh # # Launch and command shells # . mySecondShell.ksh #this launches a sub-shell #now is something like this possible?... (7 Replies)
Discussion started by: MarkZWEERS
7 Replies

9. Shell Programming and Scripting

Different type of shells?

Hello there, i just want to know what are the different type of shells and the main difference betwee them. The problem is that if you try to search over the net you will find a lot of information and hence you will have no enough time to read all of them.....Anyone can help with this?? (1 Reply)
Discussion started by: charbel
1 Replies

10. UNIX for Advanced & Expert Users


I have came across the definitions of these shells korn bourne c etc .. but honestly till now i din't get the exact difference between these threes , the advantages ..... can anyone pinpoint me where it actually lies ..... don;t include me answers like aliasing in c is posible and not in bourne ..... (3 Replies)
Discussion started by: dino_leix
3 Replies

Featured Tech Videos