[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re can't the shell do a better job



On Sun, 2 Jan 2005, Gregory Seidman wrote:

AFAICT, zsh and tcsh are pretty nearly equally good, for some definition of
good. If I were willing to put the effort into it, I expect I could port
all of my tcsh shell customizations to zsh without compromising any of the
features I have grown used to. A quick look at its man page seems to
indicate that it has a superset of tcsh's features (n.b. that's features,
not syntax).

I second this. I switched to zsh some time ago, and it's quite spiffy.
It "feels" similar to tcsh in interactive use. Some of the cooler, more
advanced features require Deep Knowledge that I mostly haven't acquired.
(Haven't wrapped my head around "styles", for one.) A few things I've
noted in my own use:

* The completion system is very good, and smart completions for many
  different commands are standard. I think you can get write a
  completion to get zsh to feed your fish, but that requires knowledge
  of styles.

* Prompt setup is even better than tcsh's (which is pretty good).

* Complex aliases can be made into shell functions.

* You can now do "VAR=value command" to set a variable for just the one
  command, like everybody else in the world does. <grin>

* You can bind keys to scripts that manipulate the command line you're
  currently editing. One keystroke pops me into vi where I can edit,
  quit, and run my edited command.

* push-line: you're typing up a fairly complex find command, and you
  suddenly can't recall if find on this machine has -regex. Just hit
  Ctrl-Q, and you've got a new, blank command-line whence you can run
  man find. When you're done with man (actually, the next time zsh
  displays a prompt), your find command is back, with your cursor right
  where you left it.

* bash-style process substitution: diff =(sort file1) =(sort file2)
  instead of:
     sort file1 > file1.sorted
     sort file2 > file2.sorted
     diff file1 file2

- Aaron

--
Aaron Hall           :    Actually, it's a buck-and-a-quarter quarterstaff.
ahall@vitaphone.net  :    But I'm not telling *him* that!



Reply to: