Gentoo Forums
Gentoo Forums
Quick Search: in
ZSH customization and system shell -Solved
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
shaumux
l33t
l33t


Joined: 13 May 2005
Posts: 907
Location: India

PostPosted: Wed Aug 13, 2008 9:37 am    Post subject: ZSH customization and system shell -Solved Reply with quote

I installed zsh and set it up the i would like,
still some things remain
1. I don't get the coloured output from ls etc. how do i enable those?
2. Also can i use ZSH exclusively making it the system shell and how do i gou about doing it
Do i just link /bin/sh to it or is there a gentoo way.
3. Also i chose to use the gentoo prompt but i would like to modify it just a little and replace % with $ in a user prompt
Can i do that without creating a new prompt from scratch?

Thanks


Last edited by shaumux on Fri Aug 15, 2008 6:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
yngwin
Developer
Developer


Joined: 19 Dec 2002
Posts: 3536
Location: in the Dutch Mountains ;-)

PostPosted: Wed Aug 13, 2008 7:21 pm    Post subject: Reply with quote

1) add alias ls="ls --color" to your .zshrc, and similar lines for other commands
2) set your default login shell in /etc/passwd
3) i don't know, i just made my own
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
shaumux
l33t
l33t


Joined: 13 May 2005
Posts: 907
Location: India

PostPosted: Wed Aug 13, 2008 7:25 pm    Post subject: Reply with quote

Thanks for th reply.
Still is it safe to link /bin/sh to zsh instead of bash?
Back to top
View user's profile Send private message
mv
Veteran
Veteran


Joined: 20 Apr 2005
Posts: 1542

PostPosted: Thu Aug 14, 2008 8:27 am    Post subject: Reply with quote

shaumux wrote:
Still is it safe to link /bin/sh to zsh instead of bash?

No.
Back to top
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 03 Nov 2004
Posts: 1080
Location: Victoria, BC, Canada

PostPosted: Thu Aug 14, 2008 12:08 pm    Post subject: Reply with quote

mv wrote:
shaumux wrote:
Still is it safe to link /bin/sh to zsh instead of bash?

No.

Why not? Several of my systems have been running quite happily for several months with dash as /bin/sh, and I'm pretty sure zsh provides at least the same functionality as dash even in sh emulation...
_________________
Saving the world, one kilobyte at a time.
Back to top
View user's profile Send private message
mv
Veteran
Veteran


Joined: 20 Apr 2005
Posts: 1542

PostPosted: Thu Aug 14, 2008 12:50 pm    Post subject: Reply with quote

tarpman wrote:
mv wrote:
shaumux wrote:
Still is it safe to link /bin/sh to zsh instead of bash?

No.

Why not?

Sigh - so I have to give the long answer.
  1. It is currently not even completely save to use dash as /bin/sh. I also use it, and most things work, but it is not safe. For instance, several init-scripts are still not sh-compatible (most notably that of udftools, although the bug report soon has its first birthday), and even basic things like "man" do not work properly.
  2. Scripts using bashisms will usually not run anyway, most notably [[ $VAR ]] gives an error.
  3. It simply does not make sense to link /bin/sh to zsh: zsh switches only into an "sh-compatibility mode" which is certainly not what the OP wanted to have with this link (e.g. if the login-shell is /bin/sh, root will not have a "proper" zsh, but only a "sh-compatibility-mode zsh").
  4. Even in the sh-compatibility-mode, zsh probably does not behave exactly like dash (if no bashisms are used in the script). I have not checked, but it is certainly not too hard to find some special variables which are set in this case which are not set for dash or which - when set - have some special meaning. Moreover, some zsh commands are not fully POSIX. Recently, I found e.g. that "time -p" does not work (or works differently) for zsh.
  5. And again: it simply does not make sense to link /bin/sh to zsh: For dash, this is useful, because dash is faster and smaller than bash. But replacing bash by an even larger shell - if the additional power is not used - simply does not make any sense.
Back to top
View user's profile Send private message
shaumux
l33t
l33t


Joined: 13 May 2005
Posts: 907
Location: India

PostPosted: Thu Aug 14, 2008 2:31 pm    Post subject: Reply with quote

Thanks for explaining.

So if dash is faster and smaller can I use dash as /bin/sh and get rid of bash?
Back to top
View user's profile Send private message
mv
Veteran
Veteran


Joined: 20 Apr 2005
Posts: 1542

PostPosted: Fri Aug 15, 2008 2:45 am    Post subject: Reply with quote

shaumux wrote:
So if dash is faster and smaller can I use dash as /bin/sh

Yes, with some limitations which I have mentioned: You have to patch some initscripts and man (the latter can be avoided by exporting MANPL=65535, but this is only a dirty hack). Occassionally there are also some bash scripts which have mistakenly written "#!/bin/sh" in their header although they mean #!/bin/bash, and sometimes badly written configure oder make scripts fail, i.e. you have to be prepared to write some bug reports. But this does not happen very often.
Quote:
and get rid of bash?

It depends on what you mean by "getting rid". If you mean "erasing from your harddisk" the answer is negative, because many programs depend explicitly on /bin/bash, the most important being portage.
Back to top
View user's profile Send private message
ocin
Guru
Guru


Joined: 01 Jan 2006
Posts: 457

PostPosted: Fri Aug 15, 2008 5:31 pm    Post subject: Reply with quote

1. do not unmerge bash
2. man chsh to change your default login shell (or edit /etc/passwd manually)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum