Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 03-11-2012, 10:46 AM   #1
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Rep: Reputation: Disabled
Have sh Be Something Other That Bash/Dash.

I can use dpkg-reconfigure dash to switch sh to ether bash or dash.
My favorite shell isn't bash (unlike so many other people...) it's The Z Shell (zsh).
How would I switch sh from dash to zsh (yes I am aware of /etc/passwd and have already edited it and am aware of the slowed boot times). I don't have a GUI just command-line.

Last edited by Zssfssz; 03-11-2012 at 10:48 AM. Reason: Typo
Old 03-11-2012, 01:53 PM   #2
Senior Member
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,793

Rep: Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618
no no no no no no no no ...

You should not pick /bin/sh based upon what you like.
You should pick /bin/sh based upon what best supports your system scripts (current and future) as provided by your distribution. Most often that means not messing with it.

You select your OWN shell based upon what you like, and let your SCRIPTS run the one that has the features you like using the '#!' line.

That said, it IS possible to change it to any valid shell (or invalid shell, but PLEASE do not do that!) manually. IT is a simple link.

Check the man page and info documents for 'ln' before starting any manual changes, and do understand that you can disable your system if you mess it up.
Old 03-11-2012, 01:59 PM   #3
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Yeah, what wpeckham said.
Your system was configured to use bash (or whatever) for reasons understood by the developers. That should have NO influence on what shell or scripting language you prefer to use. If you want to write your scripts using zsh, that should be perfectly fine, and should be done independently of existing system scripts. The default shell used by each user is configurable, as you have already discovered.

--- rod.
Old 03-12-2012, 01:08 AM   #4
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Original Poster
Rep: Reputation: Disabled
Anything invoking a shell as sh should only posix features (not to mention that the person could of used /bin/bash or /bin/dash)! ZSH checks to see if it is ran as sh then emulates it as close as possible. Debian is currently just my toy os (occupying only 41Gs on my HD) easily reinstalled, reconfigured (with scripts hosted on the Ubuntu Partition), and deleted. (with less than 500 packages installed and about 400 of them are on the install media the others, again, downloaded to a folder on the Ubuntu partition; Installing the remaining packages is not a problem ) Now to make you happy I'll try it in a qemu test os first.
Now how do I change /bin/sh?
Old 03-12-2012, 08:34 AM   #5
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
/bin/sh is nothing more than a symlink to the shell in use. Just let it point to /bin/zsh to achieve what you want.
Old 03-15-2012, 09:48 AM   #6
Senior Member
Registered: Sep 2011
Location: Surrey/Hants Border, UK
Distribution: BSD & Linux - As long as they are Lightweight
Posts: 1,704

Rep: Reputation: Disabled
...or perhaps 'chsh' is what you are after....


debian, shells, zsh

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] difference between /bin/bash and /bin/dash and compatibility with POSIX kakk2 Linux - Software 7 11-11-2011 02:17 PM
bash (esc dash) key combo? szboardstretcher Linux - Software 1 08-23-2011 02:34 PM
BASH/Dash : how to put a JPEG or PNG into the Clipboard? Xeratul Linux - General 10 12-08-2010 04:06 PM
gtkdialog + glade + bash/dash/sh librano Programming 4 11-26-2009 03:46 AM
Need help with BASH and DASH cosmicbrat Linux - Software 1 03-12-2009 09:39 PM

All times are GMT -5. The time now is 10:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration