To Z Or Not To Z 148
Blasphemous Preist writes "For all of you looking for a good religious war over shells, IBM has just posted the following article on zsh.
It's very informative and comes from a strong Linux and Z-shell proponent. If you're in to hack around with something other than bash zsh may be z answer."
"Csh Programming Considered Harmful" (Score:1)
csh and its derivatives are just fundamentally broken. I tried it back in 1985 and quickly grew to hate it.
Let the damn thing die already.
Bah (Score:2)
Re:Zsh advocacy (Score:2)
Another of my favorite zsh features is shared history. Zsh can be set up to share one command-line history list amoung all the zsh's you have running. So all of my xterms share the same history and I don't have to remember in which one I ran what command.
Re:tcsh forever!! (Score:1)
-Dom
Re:Top 10 reasons for usung Z-Shell (Score:1)
-Dom
Re:PSH - because perl is a "real" language (Score:1)
A shell has different requirements to a programming language, don't get them confused (even though they cross over a little bit).
-Dom
Re:Shells in a Nutshell (Score:2)
I thought the t was for tectronix.
many irix users dont use the shell (Score:1)
Re:Shells in a Nutshell (Score:2)
Re:PSH - because perl is a "real" language (Score:2)
Tcl is often considered to be too much of a toy language, but I think as a shell it would actually fit quite nicely. And for all its toyness, it's actually quite elegantly simple and easy to understand.
Re:tcsh owns you all, really (Score:1)
Re:tcsh owns you all, really (Score:1)
Re:yuck (Score:2)
It expands to all the argument passed to the current program or function, just with different quoting semantics to $*. Your point being?
Re:Most "normal" people? (Score:2)
Putting a user-interface preference into the file system is a really stupid thing to do and NT should be blasted for it. However I would agree that Unix shells and file choosers could make the assumption that people may mistype the case of their filenames and it should be fixed. While they are at it they could do spelling correction and other such stuff (I bet you think the file system should do spelling correction too, since you think the case-insensitive parts of it are a big win, huh?)
Re:tcsh owns you all, really (Score:2)
NT does not accurately transform letters between case for Unicode at the filesystem level. They have decided (quite rightly) that doing this is an enormous security hole (because of different systems getting the rules differently and thus failing to notice that a program is going to clobber an existing file).
The proper place to do anything complex like this is at the user level. Unfortunately NT is forced to be back-compatable with their case-insensiteve file system so the case matching is rather complex and spread between two systems.
Unix design is in fact correct, where the filenames are a stream of bytes. The interpreteation of these bytes should be left for the user level.
A legitimate complaint would be that the Unix programmers keep neglecting to put such stuff into the user level. That is true. But the NT file system is wrong, and the engineers at MicroSoft are well aware of this fact.
Re:tcsh owns you all, really (Score:2)
I do think there is a legitimate complaint that the user level programs do not do more to help people with case-insensitve searches. They also don't handle spelling errors very well either.
However there is no reason to put case-insensitive rules into the file system itself. It is actually counter-productive for real case insensitivity since it often precludes making smarter front ends since it hides information (NT has some difficulty here). Also the rules for Unicode/UTF-8 are FAR too complex to rely on in code like a filesystem which security relies on.
My personal preference is for partial case-insensitivity: lower-case that I type in matches both upper and lower case, but upper case matches only upper case. This was the rules for the Final Word word processor I worked on in 1985, but for some reason these rules have totally disappeared from modern software. It worked great because it would find words at the start of sentences, but you could search for proper names (or sentence starts), and we didn't need a "case insensitive" switch.
In any case, no matter what the ideal user experience is, it definately should be moved out of low-level things like the file system. NT has got to fix this or they are going to get killed with security problems, especially in a hetrogenous environment of shared file systems.
Re:There's a debate like this for NT users: (Score:2)
All of these shells have been ported to NT, so in fact you get exactly the same question there as well.
Re:tab completion... (Score:2)
Everybody realized pretty quickly that partial completion is far better. Of course MicroSoft is pretty far behind (for mysterious reasons, certainly there was somebody there who had used Unix file completion, and could have told them how to do it right...)
Re:tcsh owns you all, really (Score:2)
I believe they all are wrong, as I would prefer the assignment of meaning to these bytes be moved out of the file system and into user space. The reason is that there is far more complex matching rules (such as spelling correction and full UTF-8 case independence) that need to be done as well, and a partial solution like this is worse than none at all.
Re:tcsh owns you all, really (Score:2)
Re:Most "normal" people? (Score:2)
The problem with NT, etc, is that they assign meaning to those bits stored in the directory at a very low level. This prevents usage of those bits for more general purposes, and prevents smarter assignment of meaning at higher levels. If NT had stored raw 8-bit data like Unix does, they could have supported Unicode with NO CHANGES TO THE FILE SYSTEM (this would be done by using UTF-8, which also has the advantage of being upwardly-compatable with 8-bit names).
I totally agree that Unix user-level programs are written by lazy programmers who think that making it hard to use is kool. It is amazing that case-independent filename completion has taken so long and is still not the default for these shells. But for too long everybody has attacked this with equally lazy and very wrong ideas where this is stuffed into the file system.
Your terminology is wrong. Unix is case-preserving. The systems you are talking about (and also some Unix filesystems like AFS) are case-preserving + case-independent. Old MSDOS file systems were only case-independent but not case-preserving.
I also find it interesting that you are so enamored of an NT feature that is useless except for command line programs. The "overwhelming majority" of people click on files and would never notice if there were several files with the same name, and are not going to be bothered because both "Buffalo" and "buffalo" exist.
Shells vs. telnet (Score:1)
--
It could be coffe.... or it could just be some warm brown liquid containing lots of caffeen.
Re:Shells in a Nutshell (Score:2)
OTOH, if you aren't concerned with writing portable shell scripts, why deny yourself the benefits of a nicer shell for interactive use? Maybe it is not worth 'learning' zsh as some kind of chore or training exercise, but if there's a feature you would like to use, go and use it. If people took the same viewpoint with all software - don't bother learning it unless it is there on all Unixes - 90% of the stuff on a typical Linux system would disappear.
Finally, it's not usually hard to install something like zsh. Not hard at all on Linux, and Linux makes up the majority of Unix-like systems out there.
Re:tcsh owns you all, really (Score:2)
It just shows that this is a matter of individual taste, and of course it should be programmable so you can choose the style you prefer.
Re:Two things that alone is enough to use zsh (Score:2)
Does that mean that:
rm **has much more disastorous consequences than I would normally expect?
-"Zow"
Bash and case-insensitive completion (Score:2)
This also works on Cygwin on Windows NT, by the way, which is by far the nicest command line environment I've used on NT.
Learn shell-independence (Score:2)
Although I use bash at home, I'm trying to restrict myself to the intersection of bash, tcsh and ksh, one of which is present on most Unix/Linux boxes these days. Not pleasant, particularly since Solaris ksh doesn't support arrow keys, but better than having to use completely different key bindings everywhere. Bash deserves some credit for emulating most of the csh !$ type features.
The nicest shell I ever used was called msh, which completed whole lines from the command line history, then individual words, then files/directories, all using TAB. zsh and co can probably do this by now, I used msh back in the mid-Eighties.
Re:tcsh owns you all, really (Score:2)
Re:Hi (Score:2)
Re:Tcsh sucks (Score:1)
in french. filename command etc...
Re:What the? (Score:2)
RedHat's manual is chock full of instructions that include things for you to type at a shell prompt, and it comes with thousands of executables that aren't tied to anything in the GUI. Admittedly, you could access most of those by creating icons, but that's not so hot for the ones that require varying command line parameters.
So RedHat may be intended to minimize shell usage for everyday tasks, but it's neither intended nor suitable for completely ignoring the shells.
-
Re:Shells in a Nutshell (Score:2)
It doesn't. If you write a script, and test it with #!/bin/sh where sh == bash, without taking special care to limit yourself to standard sh, don't expect it to work with other /bin/sh's. You'll end up with a script that only works with bash in sh comatability mode. In that case you're better off just using #!/bin/bash (or whatever shell you use), so whoever installs your script knows what shell they actually need.
I would say write for whatever shell you want. Bash is a good bet, as it's available on all linux systems (but be careful; you might inherit an old box with only bash-1!). Zsh is not nearly as common, but it is trivial to install, and has some really nice conveniences to make it worth the effort.
Re:Two things that alone is enough to use zsh (Score:2)
Here's another one: short-form loops...
for i (*) { echo $i }
Useless example, but you get the idea.
Re:Two things that alone is enough to use zsh (Score:2)
Blech. I find "{ ... }" much nicer than "do ...; done". Besides, if you've got more than one command to do, you have to type "do { ... }; done". In that case, why not drop the do/done and just use the braces?
Do/done bothers me, because all of the other languages I write code in just use the braces without superfluous do/done keywords (okay, maybe the occasional "do").
all your shell belong to unix (Score:1)
move zsh
somebody set up us the bash.
move zsh
zsh
Re:Shells in a Nutshell (Score:2)
Just check the comp.sys.shells faq
Perhaps you meant the comp.unix.shell FAQ? Good pointer. The one with the feature list you are referring to is right here:
UNIX shell differences and how to change your shell [landfield.com]
Definitely worth a read. And a specific FAQ on ZSH:
Z-shell (zsh) Frequently-Asked Questions [landfield.com]
Of course, I have a vested interested in seeing people switch to zsh. It is my primary shell, and the more people use it, the more boxes will come standard with zsh, and the less frequently I'll have to revert to bash.
Re:tcsh owns you all, really (Score:1)
mutende:~$ echo X{a,b,c,d}{1,2,3,4,5}
Xa1 Xa2 Xa3 Xa4 Xa5 Xb1 Xb2 Xb3 Xb4 Xb5 Xc1 Xc2 Xc3 Xc4 Xc5 Xd1 Xd2 Xd3 Xd4 Xd5
mutende:~$
--
Re:You Post this at 2:47AM... (Score:1)
Pope
Freedom is Slavery! Ignorance is Strength! Monopolies offer Choice!
Re:Two things that alone is enough to use zsh (Score:1)
e.g.
$ pwd
/home/slams
$ CDPATH=.:$HOME:/usr/local:/usr/local/www
$ cd bin
/usr/local/bin
$
(assume there isn't a bin/ in either . or $HOME)
Re:Bash and case-insensitive completion (Score:1)
- Brian
Re:Learn shell-independence (Score:1)
~Tim
--
Re:z's (Score:1)
As well as Canada, Australia, Ireland, and practically anywhere else except the US. I remember occasionally the Canadian distributors for US corporations are too lazy to repair the "English" on product packaging, and we end up with products like E-Z wipes.
I won't even mention the quality of the mandatory French translations we see. Actually, one example is worth citing:
Occaisionally we see the phrase "No preservatives" translated to "Sans preservatifs" on food packaging. The actual translation should be "Sans agents de conservation", which wouldn't be so funny except for the fact that "Sans preservatifs" translates to "No Condoms Inside".
Brilliant.
Re:z's - Now whose English needs fixing? (Score:1)
I remember occasionally the Canadian
and of course, later on:
Occaisionally
It's still early...
Two things that alone is enough to use zsh (Score:3)
~myhome% hash -d lbin=/usr/local/bin
~myhome% cd ~lbin
~lbin% pwd
/usr/local/bin
2.
/% gzip **/*.dvi
gives the same result as
/% find -name "*.dvi" -exec gzip {} \;
Re:What the? (Score:1)
Re:tcsh owns you all, really (Score:1)
OTOH, most european languages need also non-ascii characters, and saying "À is the capitalized version of à" is something that you can do only if you know what encoding has been used for the name of the file, and then we are still ignoring names in nonalphabetical languages with variable length encodings. Since some system calls require the name of a file as a parameter, this knowledge should be built in the kernel, with all the bloat it requires.
As you see, this is the sort of thing that better lives in userspace.
Re:tcsh owns you all, really (Score:1)
This is why UTF-8 exists and is used on most unices, and why I consider it a better solution than plain (untrasformed) UNICODE (or UCS-16, if you like).
See this page [cam.ac.uk] for further reference.
Re:Shells in a Nutshell (Score:1)
Re:Shells in a Nutshell (Score:3)
Another feature that is nice is automatic sanity mode, which pretty much nullifies those times you have to stty this or that just because some vendor still hasnt gotten it right. Commandline editing and arrow keys work, whatever platform you're logging in from.
Just check the comp.sys.shells faq
zsh is good if you have a HP/IBM/Sun workstation and you need a shell that will just work FOR you, and you dont have the time to spend to configure the various shells into something resembling a sane environment. It's the ultimate commandline environment.
For obvious reasons it isnt good for scripts that are to be deployed over various platforms, but then ksh is pretty much the least common denominator there. Altho considering the various vendor bugs in that you could probably just spend the time to install perl or bash across the platforms so you get a scripting language with the same bugs on all machines.
color prompt on Windows 2000 CMD window (Score:1)
red='%{\033[31m%}'
grn='%{\033[32m%}'
yel='%{\033[33m%}'
cyn='%{\033[36m%}'
whi='%{\033[37m%}'
prmtWinTitle='%{\033]0;%D{%Y%m%d-%H%M%S%a} %~\007%}'
prmtDate="${grn}%D{%m%d%a}-${grn}%D{%H:%M:%S}"
prmtHistNum="${cyn}%2!"
prmtHost="${whi}%m" # just in case you want to add it.
prmtLft="${prmtHistNum}%(!.#.>) "
prmtRgt="${yel}%60<...<%~ ${prmtDate} ${whi}%?"
PROMPT=$(echo "${prmtWinTitle}${prmtLft}${whi}")
RPROMPT=$(echo "${prmtRgt}${whi}")
unset red grn yel cyn whi
unset prmtWinTitle prmtDate prmtHistNum prmtHost prmtLft prmtRgt
---
I'm still looking Zelda 2 disc version for the Famicom.
Why I love ZSH. (Score:1)
ct=$(xprop -id $WINDOWID | grep WM_NAME | cut -d=-f2 | tr -d \")
;;
esacprecmd() { print -Pn "\e]0;$ct - %~\a"}
prexec() { print -Pn "\e]0;$* - %~\a" }
When I use X, my xterms will display the name of my xterm, concatenated with my present working directory. When I execute a command, this command will now be in my xterm title, concatenated with the present working directory.
I do not know of an equivalent to preexec() in bash.
Re:Two things that alone is enough to use zsh (Score:1)
Re:tcsh owns you all, really (Score:1)
zsh% echo x{1..20}.txt
x1.txt x2.txt x3.txt x4.txt x5.txt x6.txt x7.txt x8.txt x9.txt x10.txt x11.txt x12.txt x13.txt x14.txt x15.txt x16.txt x17.txt x18.txt x19.txt x20.txt
Re:tcsh owns you all, really (Score:1)
Even better, the latest zsh has completion support for commands that output help text via "--help". This allows it to automatically query the program for the command-line options and to complete them, including giving you the help-text. For example:
zsh% diff --i<TAB>
--ignore-all-space -- ignore all white space
--ignore-blank-lines -- ignore lines that are all blank
--ignore-case -- case insensitive
--ignore-matching-lines -- ignore lines that match regex
--ignore-space-change -- ignore changes in the amount of white space
--initial-tab -- prepend a tab
Other completion areas include fabulous support for CVS (e.g. "cvs commit <TAB>" completes only files that need to be commited), completion of installed RPM package names, completing job numbers that belong to the current user, and that just barely scratches the surface.
Re:z's (Score:1)
Zsh advocacy (Score:5)
I use it as my default shell everywhere I work, on both NT and Unix. Here's some of the features that I love:
Programmable Completion
You can define completion for different commands in different ways. eg.
ping/telnet completes with the list of machines on my network
man completes with my man pages
kill completes with job numbers
java completes with all my available Java classes (I have to provide a Perl utility to help with this (classfind [demon.co.uk]) though)
Recursive and intelligent wildcarding
ls **/* completes through directories, subdirectories and the like. I never really have to use find anymore
ls **/*(ah-5) finds files accessed within the last 5 hours
ls **/*(L0) finds files of zero length
ls **/*(@) finds symbolic links
etc.
Jerry Peek has quizzed the Zsh mailing lists for info so he can write about it in the next Unix Power Tools. Hopefully Zsh's profile will be raised somewhat.
Re:Learn shell-independence (Score:1)
You're right; completion of words and lines from history are possibly the single most useful features any shell can have. There are different techniques available:
Much as I'm a zsh zealot, knowledge of these and a few other essential key-bindings will get you more immediate benefit out of your shell than learning a new shell. I wrote a page on this:
http://adamspiers.org/computing/shells/
That said, if you already know these shortcuts well and you're thirsty for more speed and power, try out zsh's new completion system...
Re:Two things that alone is enough to use zsh (Score:1)
out for rm * command-lines and make sure you
really want to do that before doing it.
Re:But does it have a restricted mode? (Score:1)
zsh -r
That wasn't hard, was it?
Everyone missed zsh's best bits! (Score:4)
Rather surprisingly, everyone seems to have missed the biggest advantages zsh has over the other shells. Please guys, go out and try the latest development version! The amount of work spent on the 3.1.x development series over the last few years has been monumental. We're now at 4.0.1-pre-2, and its feature set is so far ahead of 3.0.x (let alone bash/tcsh) it's not even funny.
For example, the article raves about programmable completion. Quite right too - I feel like crying every time I watch someone struggle without it (although as my cow-orkers well know, I'm a bit weird like that :-)
BUT! The article didn't mention that beginning in version 3.1.6, the completion system underwent a complete rewrite, and now has sophisticated out-of-the-box completions for over 400 commands. Typing a Perl one-liner and you get stuck after perl - because you can't remember which option letters to use? Hit TAB and you get a list of all of them plus explanations. Want to quickly browse the structures of some of your MySQL tables? Type mysqlshow , hit TAB, and you get a list of your databases to complete from. Choose one, hit TAB again, and you get a list of the tables within that database. Want to scp an awkwardly-named file from a remote machine? Type a few letters of it, hit TAB and zsh will connect to the remote machine, get a file list, and use it to complete the file so you don't have to type it.
If you want to know more, have a look at
http://adamspiers.org/computing/zsh/
Things have moved on a bit since I wrote it, but it should hopefully give you a taster.
The article also mentioned prompts ... Well, if you're into eye candy,
there's also a prompt theming system which I confess to writing :-)
ObScreenshot:
http://adamspiers.org/computing/zsh/files/prompt s/
Re:yuck (Score:1)
% cmp <{echo hello world} <{echo hello Xorld}
/fd/6
you are so right...that is so much more powerful than this:
zsh% cmp <(echo hello world) <(echo hello Xorld)
/proc/self/fd/11
Next time, at least look at the shell before dismissing it. I gave that courtesy to rc when it came out. I've been using zsh for over 10 years (way back when Paul Falstad was still at UPenn working on it). I've used the other shells, but I just like the feature set of zsh better.
But honestly, the best shell ever was the adventure shell.
(wish I still had a copy...especially with April Fools coming up.
IMHO,
Michael
Tcsh (Score:2)
Top 10 reasons for usung Z-Shell (Score:4)
9) user binding of keys for command line editing
8)
7) ignores duplicates in the history list
6) best prompt:
spider:src/linux/include/linux *
(cuts longer directory names)
5) compatible with Bourne Shell, works as expected
4) best completion
3) make |& less feeds stdout and and stdin into less, shorter than make 2>&1 | less
2) Z-Shell has the best vi emulation
1) more exclusive than vim
I recommend the stable version 3.0.8, zsh in distributions are often from the 3.1 branch. This version breaks my skeleton files and some things (vi binding) doesn't work as I'm used too.
Re:Ugh...not again. (Score:2)
It's very hard to automate repeated actions in a GUI, but easy to say "do this action 1000 times with this variation" on a command line.
--LP
Re:What the? (Score:2)
--LP
Re:Top 10 reasons for usung Z-Shell (Score:1)
Tektronix (was Re:Shells in a Nutshell) (Score:1)
Tenex was an operating system developed by BBN and used on most systems on the ARPANET by the early 1970s. It was the predecesor of DEC's TOPS-20 (also called TWENEX).
Both Tenex and TOPS-20 had programmable command completion and other features that impressed the creator of tcsh, and the rest is history.
Sources: tcsh(1), the TWENEX entry in the Jargon File, and Tektronix.com
--
Moredate padent ap... (Score:1)
--
Re:tcsh owns you all, really (Score:2)
You Post this at 2:47AM... (Score:5)
The answer is, of course, "Not To Z." It's St. Patrick's Day! Have another guinness. You have all Sunday afternoon to Z.
Re:yuck (Score:2)
but this is a bigger trend, isn't it? all the *sh Unix shells are basicaly retreads and mods of the bourne shell (even csh was written with it in mind), without fixing the fundamental problems. i think this is quite similar to the ever-increasing number of Linux distributions basicaly being retreads of Unix, but again without fixing any of the fundamental problems. rc, as you pointed out, was written for plan 9, a system written from the ground up, keeping what's good in Unix, but fixing the fundamental problems. when you ask: you could just as well s/zsh and bash/Linux and Unix/ and be asking about plan 9. well, if nothing else, it means i don't have to use crap. it provides positive alternatives. some people need crutches. some people think X is as good as window systems get. some people don't see problems with ttys and ioctls. and, sad as it is, some people like having command completion in their shells, or command history, or two (!) editors (good lord when will it end...). i've seen shells with half of
Re:Shells in a Nutshell (Score:2)
Except that most linux types call /bin/sh are really for /bin/bash :) Oh well.
Re:Command lines FOREVER (Score:1)
I know for sure Scotty uses the z-shell.
Re:Changing default shell (Score:1)
Changing default shell (Score:2)
Die-hards? I think you'd have to be nuts to use linuxconf as anything but training wheels. Anyhow, you can change your login shell with chsh(1). That works for everyone, not just root.
That aside, I thought the article was pretty good. Yes, it attributed many things to zsh which are already present in bash, but articles on interactive shell use are cool - the modern shells are awesomely deep and powerful.
Re:CLI hard to learn? (Score:2)
It's not really a matter of learning, but a matter of remembering commands, switches, config file paths etc. It's all well and good if you are used to it and do it all the time (like a sysadmin), and can be very very productive. But if you only need to do shell-optimised (which are mainly administrative) tasks very occasionally, then it's a pain having to remember a whole lot of junk that you hardly ever use. With other interfaces like webmin, GUIs etc. all the options are presented to you, so you can just drill down through menus etc. to find what you want. Probably slower than the console for a hardened console user, but for someone who does other work (productive work
Re:tcsh owns you all, really (Score:2)
This problem was a lot worse when there were versions of *nix that didn't recognize the #! protocol at the start of shell scripts.
The compatibility problems between c and non-c shells was enough that I just gave up on 'c's. That having been said, the one thing I miss the most (I rarely used filename completion) was the {a,b,c} filename expansion construct. It was kinda nice being able to generate 20 filenames with X{a,b,c,d}{1,2,3,4,5}. It's about the only thing in the c shells that I'll skip out of ksh to play with from time to time.
--
tab completion... (Score:1)
tab completion in windows (cmd.exe)
Re:tab completion... (Score:1)
Re:Fish (Score:1)
--
Most "normal" people? (Score:1)
In fact, the only UNIX application I can think of which is purposely case-insenstive in some areas is GNU Emacs, with regards to the default incremental search and DIRED filename-completion.
--
Re:Bah (Score:1)
And in my quest to give an old NT4 box a usable console, I discovered (via Google) a registry hack to give NT4 command-line completion.
My main use for these boxes is telnet. I've also noticed that in NT5, the telnet client is more integrated; in NT4, typing "telnet" opens a new window, which is endlessly annoying. The ability in NT5 to run telnet in a command window means that I can run telnet full-screen -- and almost pretend I'm using a real computer. :-)
--
Shells in a Nutshell (Score:3)
All dominant shells are either Bourne shells or C shells. Bourne shells are descendants of the original sh, written by S.R. Bourne. The Bourne shell was a great scripting language (which resembles Modula-2), but was not well-suited for interactive use. The C Shell csh), written by Bill Joy, attempted to remedy this by providing such novel features as job control and was much nicer for the interactive user, but its C-like scripting language in the original implemenation was clumsy and buggy.
The KornShell (ksh), created by David Korn at AT&T, is the best of both worlds. It's a Bourne shell with tons of new scripting features, plus all of the C shell's interactive advantages. The KornShell is now the standard UNIX shell; you'll find it on all real (read: certified) UNIX systems, including Solaris. AIX, HP-UX, IRIX, SCO, et cetera.
Tcsh, the Tenex C shell, is a suped-up version of the Berkely C shell. I like to think of it as what the KornShell would have been if it were csh-based. This shell is not "standard" but is found on most UNIX systems regardless.
If you have to learn one shell, learn Korn. Why a Bourne shell? Because there are simply some times when you can't use a C-shell -- when editting the standard system scripts, for instance. Most of these scripts are written in the UNIX-vendor's sh implementation, which is different than Korn, but much closer to Korn than Tcsh. Why use Korn instead of just plain-old sh? Because sh is dreadful for interactive use!!
Now we come to bash. Bash is the GNU implementation of a Bourne shell, and is comparable to tcsh in its feature-set. Bash is the standard shell on GNU/Linux systems, as well as the shell which the GNU/Linux system scripts are written in, which is convenient.
However, many GNU/Linux newbies are under the impression that bash is the standard UNIX shell, which is NOT the case. There are endless differences; RTFM. The two good reasons to make your sysadmin install bash anyway are these: awesome command-line completion and the best EMACS command-line editor available!
C shells are by no means dead, however. FreeBSD, being loyal to its BSD roots, still uses a C shell as its default. (Although once again the system scripts are still in sh. ;-) Until FreeBSD 4.1, the default shell was the Berkely csh; in 4.1 and later, they use tcsh.
OpenBSD's standard shell is pdksh, a freeware clone of ksh. Personally, I find this shell obselete, because the real ksh is now (finally!) freely available from AT&T, and the pdksh is not KSH93-complaint.
So there are five shells you have an excuse for knowing: sh, csh, ksh, tcsh, and bash. (Gesundheit!)
The topic of this article is the Z shell, to which I say; Bah, humbug! While learning another shell might be a good way to spend a quiet weekend, the benefits are questionable. It's one which you'll never be guaranteed to have on a UNIX, GNU/Linux, or BSD system. You should only bother to learn a new shell if you're switching UNIX/Unixes or your current shell is missing features.
--
Re:tcsh owns you all, really (Score:2)
That's probably why it's not documented otherwise it would probably be a settable option (like command history)
Rich
zsh and joe (Score:1)
Re:tcsh owns you all, really (Score:1)
Re:tcsh owns you all, really (Score:2)
Even with just one completion rule, specifically "complete cd p/1/d/", when there's only one directory that begins with "a" among dozens of files starting with "a", typing cd a is damn nice. After having this for years, it's hard to imagine using a shell without it.
Do any of the shells other than tcsh have programmable completion? It really is a killer feature that is hard to give up.
Re:Zsh advocacy (Score:1)
So you can type ``rm -rf *'', then hit <Tab>, and go back and delete that one thing you want to leave.
Re:tcsh forever!! (Score:1)
Re:Learn shell-independence (Score:1)
And if you want portability, stick with only Bourne shell syntax. And definitely throw bash outta there. Then again, this is your interactive life, and you can do what you want.
Re:Changing default shell (Score:1)
Re:yuck (Score:1)
I also took a closer look at rc and your sh. (Wouldn't a different name have been appropriate?) They have some really powerful features. Especially the file descriptor replacement thing that you exemplify. (zsh-workers! Steal this feature!) (By the way, zsh has a multiple redirection feature, but I'm pretty sure it won't work for stuff like cmp that needs two different inputs. It just concatenates things together into the input file descriptor, like ``cat < file1 < file2''.) But one thing that you miss is that these shells (zsh, bash, tcsh, etc.) are intended (at least in my mind) for interactive use. There's little need for being able to scroll back up in command history if you're programming a script. I find it unlikely that anyone would seriously write big scripts using those shells (although I have written stuff for personal use in zsh because of some nice glob and word modifiers). They use sh, or maybe ksh for something complex, because it's pretty well guaranteed to be portable. rc and your sh would be appropriate as well, if they were as or nearly as ubiquitous as sh and ksh are, whereas zsh, tcsh, and bash are not appropriate for that sort of thing, at least due to their size and related dilatoriness. (Despite this, there are a number of Linux distributions that have any number of scripts written for bash, whereas those who know what they're doing use ash (Almquist's a shell, not adventure shell), which is about as tiny as you can get.) Regardless, for interactive use, those of us with fallible fingers (and brains) want fancy command completion and interactive histories. That's why no one really uses sh or csh interactively anymore. If one added those types of interactive features to those shells, you might just have a couple of hits on your hands.
And, as a side note, zsh actually implements many (most?) of its features as loadable modules, which I noticed you mentioned as a feature of your sh. So you're not out there toally alone. zsh is still (much) bigger, though.
What the? (Score:1)
I can't really understand why this appeared on Slashdot, though. I mean: "Most developers and users of Linux come into contact with a UNIX shell sooner or later." ?? Sooner or later? How could anyone use Linux (or any other unix-like os) without coming into contact with a UNIX shell first and foremost?
The mind boggles.
Re:What the? (Score:1)
Re:What the? (Score:1)
PSH - because perl is a "real" language (Score:2)
There is absolutely no reason why perl or python or ruby or some real programming language shouldn't also be the langauge you use interactively.
Re:What the? (Score:2)
Developerworks isn't IBM, exactly (Score:2)
In fact, I'm working on an article for dW now...
A host is a host from coast to coast, but no one uses a host that's close
tcsh forever!! (Score:2)
Re:tcsh forever!! (Score:2)