You are not logged in.

#1 2007-07-24 10:20:47

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

Bash & Zsh

while searching for UNIX shells i came across ZSH here: http://zsh.dotsrc.org/

i liked it. just like BASH has all the facilities of UNIX shells "sh" and "ksh", or better, bash was the GNU incarnation of UNIX shells, ZSH is the throw-in for sh, ksh and BASH along with lot more functionalities . i loved the ZSH idea.

1st, i still love ZSH but i no longer use it because i have committed to keep myself always attached with GNU Operating System efforts and BASH is the shell of GNU system. 2nd, i also found that ZSH is slower than BASH e.g. when i keep BASH as my login shell  then "startx" happens to start 2 times faster than when login shell is ZSH.

i was just interested in knowing what you people think about these 2 shells . why you prefer one over the other ?

Offline

#2 2007-07-24 10:26:19

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: Bash & Zsh

i think that by installing zsh-pacman from AUR the fact that u no longer use zsh will change. that alone is a reason to prefer zsh over bash imo.
pacman tab completion ftw!
plus theres other stuff like speed for example. zsh is much faster


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#3 2007-07-24 10:26:29

mucknert
Member
From: Berlin // Germany
Registered: 2006-06-27
Posts: 510

Re: Bash & Zsh

Of course zsh is a tad slower: it is able to do a LOT more than bash. Alone its Autocompletition is awesome and puts bash to shame. It is a great shell for real power-users, and with that I don't mean the ZOMGIRSOLEET!-Kiddies that are just using zsh (or dwm) to look cool. For that power, it demands some heavier customization to truly feel comfortable.

After trying out the zsh myself I've figured that this thing is really awesome but that I don't need all its functionality. It is a nice to have but nothing more. I stay with bash for the time being and maybe I will look into zsh again when I am willing to put some effort into its configuration.


Todays mistakes are tomorrows catastrophes.

Offline

#4 2007-07-24 11:07:08

High|ander
Member
From: Skövde, Sweden
Registered: 2005-10-28
Posts: 188
Website

Re: Bash & Zsh

I agree with mucknert, zsh has some really nice features, but i don't use any of them, that is why I also use bash.


When death smiles at you, all you can do is smile back!
Blog

Offline

#5 2007-07-24 17:23:46

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: Bash & Zsh

What metric do you have that Zsh is slower? I've been using ZSH for years, and never known about any speed problems...

Zsh shouldn't be any slower unless you are using a lot of autoloads for stuff you don't need ( like the built in tetris game ).

Hell, bash is even a larger executable to load into memory.  Zsh is at 476 K, and Bash is at 516 K.  (Mind you, I understand paging, and why executable size really doesn't matter that much).

If zsh is noticeably slower, than it's your .zshrc, not zsh.

Offline

#6 2007-07-24 17:56:11

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

Re: Bash & Zsh

codemac wrote:

What metric do you have that Zsh is slower? I've been using ZSH for years, and never known about any speed problems...

Zsh shouldn't be any slower unless you are using a lot of autoloads for stuff you don't need ( like the built in tetris game ).

Hell, bash is even a larger executable to load into memory.  Zsh is at 476 K, and Bash is at 516 K.  (Mind you, I understand paging, and why executable size really doesn't matter that much).

If zsh is noticeably slower, than it's your .zshrc, not zsh.

ok, then explain your reasoning here. i am curious both on "Why ZSH runs slow on my sytem?" and "why i love ZSH ?"  wink

# Lines configured by zsh-newuser-install
HISTFILE=~/.zsh-hist
HISTSIZE=10000
SAVEHIST=10000
setopt beep notify
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/arnuld/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall



# my own :)
autoload -U colors
colors
autoload -U promptinit
promptinit
PS1="%B{%{$fg[green]%}%n@%m %{$fg[red]%}%1~ %{$fg[default]%}% }%#%b "
#PS1="{%n@%m %1~} %# "
alias ls="ls -F --color=auto"
alias lsa="ls -F --color=auto -a"

# default "text-editor"
export EDITOR="emacs"

# soldiers never-ever beep at me ;-)
setopt NO_BEEP

# the "del" key
bindkey '\e[3~' delete-char
# home
bindkey '\e[7~' beginning-of-line
# end
bindkey '\e[8~' end-of-line
# insert
#bindkey '\e[2~' overwrite-mode

Offline

#7 2007-07-24 21:05:40

mucknert
Member
From: Berlin // Germany
Registered: 2006-06-27
Posts: 510

Re: Bash & Zsh

The only metric I have is the startup-time, which *seems* to be a bit longer on all of my machines when I use zsh. bash just starts up a little speedier. But during usage, I can't say that it is slower at all. *shrugs* Dunno what the OP meant. I've always thought that the increased functionality is the reason for the subjectively longer startup-time.


Todays mistakes are tomorrows catastrophes.

Offline

#8 2007-07-25 00:29:35

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: Bash & Zsh

I might be wrong, but the zsh completion seems to be cached unlike bash (zsh completion seems faster): (or rather bash checks for new/changed completions in the path more often than zsh)

after installing a new program, a previously running bash shell can complete the program's name, while zsh does that only after opening a new shell

Offline

#9 2007-07-25 10:52:04

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Bash & Zsh

I used zsh for a long while, and then went back to bash. zsh is a tad overhyped. I didn't really miss much after moving back.

Most people also ignore bash-completion when hyping zsh. AFAIK phrak made a pacman completion for bash too.

James

edit: pacman completion is included with bash-completion

Last edited by iphitus (2007-07-25 11:19:22)

Offline

#10 2007-07-25 11:07:33

Mefju
Member
From: Poland
Registered: 2006-07-12
Posts: 104

Re: Bash & Zsh

vogt wrote:

I might be wrong, but the zsh completion seems to be cached unlike bash (zsh completion seems faster): (or rather bash checks for new/changed completions in the path more often than zsh)

after installing a new program, a previously running bash shell can complete the program's name, while zsh does that only after opening a new shell

You can solve this with function from zshwiki

_force_rehash()
{
    (( CURRENT == 1 )) && rehash
    return 1
}

Then you need to add it to completer style

zstyle ':completion:*' completer _force_rehash _ignored _expand _complete _match _prefix _correct _approximate

Last edited by Mefju (2007-07-25 11:09:34)

Offline

Board footer

Powered by FluxBB