Shells | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Shells

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-09-2012
Bill Thompson Bill Thompson is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 9 October 2012, 5:16 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Shells

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
Sponsored Links
    #2  
Old 10-09-2012
rdrtx1 rdrtx1 is offline
Registered User
 
Join Date: Sep 2012
Last Activity: 17 April 2014, 5:28 PM EDT
Location: Houston, Texas, USA
Posts: 660
Thanks: 0
Thanked 200 Times in 192 Posts
Closing csh will terminate ksh.
Code:
kill -9 $PPID


Last edited by rdrtx1; 10-09-2012 at 05:45 PM..
Sponsored Links
    #3  
Old 10-10-2012
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 23 April 2014, 2:59 AM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 3,925
Thanks: 39
Thanked 676 Times in 537 Posts
Quote:
Originally Posted by Bill Thompson View Post
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.

bakunin
The Following User Says Thank You to bakunin For This Useful Post:
Piyush Jakra (10-10-2012)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Difference between shells Boby120677 Shell Programming and Scripting 1 08-07-2012 09:51 AM
shells and scripts bjstaff UNIX for Dummies Questions & Answers 1 02-14-2012 05:01 PM
why we have different shells? shahnazurs UNIX for Advanced & Expert Users 2 12-16-2008 11:36 PM
Different type of shells? charbel Shell Programming and Scripting 1 05-05-2006 08:05 AM
Shells dino_leix UNIX for Advanced & Expert Users 3 06-08-2005 06:07 AM



All times are GMT -4. The time now is 08:12 AM.