You are not logged in.
There are a lot of subtle differences between zsh and bash that make zsh much more powerful to use, but you have to use it to see the difference. (zsh has better prompt support. Nerd points +100.)
Here's the biggest problem as far as scripting goes:
let's assume we have a function named 'foo' that takes two parameters and echos them like "param1 = param2"
bash:
foo a b
# a = b
foo "a b"
# a = b
zsh:
foo a b
# a = b
foo "a b"
# a b =
bash breaks strings based on IFS, zsh does not - it's not a *big deal* but it causes alot of little snippets to fail
Offline
I wouldnt be surprised if there were a zsh option to change that behaviour. It seems to have options for everything
Offline
Not particularly. It's just little things. Like case-insensitive completion.
Bash is case sensitive by default. But that can be changed, so that's not much of a feature
bind "set completion-ignore-case on"
Generally speaking, the only incompatibilities between bash and zsh arise with scripts that use globs (I had to fix a couple when I switched over).
Right, but what I don't understand is why you had changed your scripts It would be perfectly ok to stay with #!/bin/bash in them
So you say it is worth a try? Well I'll give it a go then. Thanks.
Offline
bash can also do the zsh style "menu completion" - "bind Tab menu-complete"
However, this still doesn't expand completions below it like zsh does.
i tried zsh for a bit the other day. To me, it seems rather flaky by default... bash does everything I expect it to do with a simple "source /etc/bash_completion"
Admittedly, zsh's completion is much quicker, bash's still isn't a hinderance to me.
Offline
I love Fish. Zsh is too complicated. Bash is older than my grandma.
Offline
woohoo a thread renaissance!
I need real, proper pen and paper for this.
Offline
Anyone press tab constantly in irc and expecting it to complete? That's when you know you've been using Linux for long enough
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Anyone press tab constantly in irc and expecting it to complete? That's when you know you've been using Linux for long enough
Hey! I've had that happens to me once.
Offline
Yeah! I press tab everywhere, even in the web browser's address bar. I tend to choose applications based on how good autocompletion is
Anyway, I tried fish, it's very cool, but it broke just on the second run, after I changed my prompt:
switch: Expected exactly one argument, got 0
/usr/share/fish/functions/__fish_config_interactive.fish (line 150): switch $fish_greeting
^
in function "__fish_config_interactive",
called on line 104 of file "/usr/share/fish/config.fish",
in function "__fish_on_interactive",
called on standard input,
in event handler: handler for generic event "fish_prompt"
NAME
switch - conditionally execute a block of commands
switch: Type "help switch" for related documentation
I can't find a way to use a config file, it seems the only way to configure fish is by issuing commands. I detest it.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Configurability only complicates things, and if their defaults are good, the complexity is unnecessary. (but I disagree with that philosophy too)
Offline
I think good standards are a good starting point, and minimalism should be encouraged, but flexibility must not be overlooked.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
I'm afraid of trying new shells, until I've finally started remembering how to perform for loops in bash.
Is there any better shell which is bash compatible?
Last edited by sweiss (2008-03-01 09:36:22)
Some PKGBUILDs: http://members.lycos.co.uk/sweiss3
Offline
What do you mean by "bash compatible"? Programs/scripts call their own interpreters. "Better" shells exist for the user's sake, not for execution of software (there may be, I don't know). Things like simpler syntax, optimized syntax, tab-completion, it just makes life easier.
I need real, proper pen and paper for this.
Offline
What do you mean by "bash compatible"? Programs/scripts call their own interpreters. "Better" shells exist for the user's sake, not for execution of software (there may be, I don't know). Things like simpler syntax, optimized syntax, tab-completion, it just makes life easier.
Bash loads /etc/profile. Fish does not. So you have to keep bash as your login shell and exec fish from it. Otherwise, it will not have all the env variables.
Offline
I'll admit that I haven't really given fish a proper test, but it seems like a toy shell. I kind of like the idea of orthogonality, but I seriously doubt anything is ever going to pry me away from zsh.
zsh = <3
Offline
I'll admit that I haven't really given fish a proper test, but it seems like a toy shell. I kind of like the idea of orthogonality, but I seriously doubt anything is ever going to pry me away from zsh.
zsh = <3
Fortunately, it's not a toy shell. Those who love it, and its creator, take it seriously.
Offline
Bash loads /etc/profile. Fish does not. So you have to keep bash as your login shell and exec fish from it. Otherwise, it will not have all the env variables.
Login prompt is just a login prompt, you can't expect it do anything more than provide you a prompt. There's no point in having a "better" shell provide you a login prompt. /etc/profile is a BASH file, other shells have their own files. A better shell is for your live-action convenience. In short, yes you have to keep whatever "standard" shell most of your system gets in touch with, but you can have your own shell to get down and dirty yourself. See phrak's post above; bash can still be good.
Last edited by schivmeister (2008-03-07 19:51:46)
I need real, proper pen and paper for this.
Offline
Anyone press tab constantly in irc and expecting it to complete? That's when you know you've been using Linux for long enough
Well, I do it all the time, and it works
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
is it possible in fish, that the filetype information at autocompletition isn't shown?
i think that feature is quite useless, since you dont need a hint like "(Directory)" or "(Application, 24MB)" behind any option-for-autocompletition (you know, if you double-tap-tab)...
Offline
So, did anyone manage to customise fish without breaking it? I really liked it, but I need to be able to customise it and still have it working properly. My .bashrc is getting bigger and bigger, and I'm getting used to my functions. It would be nice to "port" them to fish as well. I really dislike the idea of not having a config file, life would have been easier that way
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
So, did anyone manage to customise fish without breaking it? I really liked it, but I need to be able to customise it and still have it working properly. My .bashrc is getting bigger and bigger, and I'm getting used to my functions. It would be nice to "port" them to fish as well. I really dislike the idea of not having a config file, life would have been easier that way
.config/fish/config.fish
Offline
Mind sharing your config file then?
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Mind sharing your config file then?
function pacman; pacman-color $argv; end;
function p; pacman $argv; end;
function y; yaourt $argv; end;
function netcfg-scan; iwlist scan $argv; end;
#Bash-like prompt
#function fish_prompt -d "Write the prompt"
# printf '%s%s %s%s %s$%s ' (set_color green) (whoami) (set_color cyan) (prompt_pwd) (set_color -o green) (set_color normal)
#end
# Hostname
#function fish_prompt -d "Write the prompt"
# printf '%s%s%s@%s%s %s%s %s>%s ' (set_color green) (whoami) (set_color -o normal) (set_color blue) (hostname | cut -d . -f 1) (set_color -o cyan) (prompt_pwd) (set_color -o green) (set_color normal)
#end
function fish_prompt -d "Write the prompt"
printf '%s%s %s%s %s>%s ' (set_color green) (whoami) (set_color -o cyan) (prompt_pwd) (set_color -o green) (set_color normal)
end
set SHELL (which fish)
Offline
Thanks a lot, now this is gonna be fun. I'll use yours as a starting point
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Ok, that was veeeeeeeeery nice. I was fiddling with fish, and I liked it. So I went on and made it my default shell. The nice thing is that at the login shell it just hangs at the MOTD (with 100% CPU usage, of course). So I couldn't get into my machine anymore, since I have disabled the root account. I had to boot up Knoppix and edit /etc/passwd manually. That's just too bad. Now I have to type "fish" every time I want to use it
Last edited by finferflu (2008-03-08 18:02:34)
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline