Domain: zsh.org
Stories and comments across the archive that link to zsh.org.
Comments · 41
-
Did anyone else double take
-
Re:yes, but...
You said good. Lack of bash = not good.
-
Re:Low
Did I go too far?
Yes. If you need to leave your shell to play tetris, you need a better shell.
-
zsh rules!
"Anyone who has used a derivative of Unix over the past 20 years has used Bash,
..."Sure, but in the end, people who really know what they're doing use the
ultimate shell, zsh (see http://www.zsh.org/ ) -
Not the only choice
I loved Bash (and was the maintained of the FreeBSD port of the Bash tab-completion for a while), but gave it up forever about a week after I tried Zsh. For me, it's like "Bash done right", from associative arrays for easy scripting to tab-completion that's fast and doesn't pollute the namespace with thousands of tiny functions:
$ zsh
$ set | wc -l
167
$ bash
$ set | wc -l
7221Which leads me to ask: has anyone tried Zsh but then gone back to Bash? If so, why?
-
Faves
CD ripping: abcde. Easy to control and customize.
Text editor: vim Yes, it is bigger than, say, nvi. But on most any machine, it usually runs lightning fast.
Shell: zsh. Not one of the smallest CLI shells, but very capable and well-documented. In many ways, easier to use than any GUI shell (and much lighter compared to any GUI shell.)
Calculator: command-line wcalc
Finances: Ledger whips everything I have ever tried; I would never switch to a GUI program for this again.
Lists and databases: colon-delimeted plain text files. Search and get records with awk or grep. Quicker and easier than spreadsheets, and I could (should) easily encrypt them with GPG.
Nutrition tracking: see sig (immodestly)
Task tracking: todo.txt
Photo sorting: just use GNOME's Nautilus and folders; all the photo album apps seem to be too much trouble. Wrote a zsh script to pull photos from memory cards, rename them so I know what camera they came from, rotate them, and dump them into a hard-drive folder so I can sort them out.
Light doesn't always pay: I got tired of trying to configure Fluxbox and Gentoo; now I'm on GNOME and Ubuntu. Light also doesn't pay for things done infrequently, as light often comes with a bigger learning curve. I usually resort to GUI tools to, for example, add users to the system.
I wish I could find a good CLI audio player--full featured, but CLI. MPD seems to come closest, but it can't get me away from Amarok. Similarly, GNUpod is pretty good for ipods, but I move stuff in and out of my iPod fairly rarely so I found Amarok is just easier to use. -
Re:How can such a mistake be made?Or use a better shell.
$ rm *
zsh: sure you want to delete all the files in /home/pete [yn]?Alternatively, my technique for years has been to use the tab key to expand wildcards. zsh is really good at that (better than bash, last I checked) and when you suddenly see the wildcard expand to several hundred files rather than the half-a-dozen you expected...
:) -
Re:How can such a mistake be made?Or use a better shell.
$ rm *
zsh: sure you want to delete all the files in /home/pete [yn]?Alternatively, my technique for years has been to use the tab key to expand wildcards. zsh is really good at that (better than bash, last I checked) and when you suddenly see the wildcard expand to several hundred files rather than the half-a-dozen you expected...
:) -
Re:Nice development
The Z Shell features some heuristics for that. If a command line performs a completion on "*" and the command is "rm", it asks for confirmation, even with -f:
hisham@brick /Depot/test]rm a*
hisham@brick /Depot/test]rm *
zsh: sure you want to delete all the files in /Depot/test [yn]? n
hisham@brick /Depot/test]rm -f *
zsh: sure you want to delete all the files in /Depot/test [yn]?
Obviously, as everything in zsh, this is configurable (setopt -u rm_star_silent to disable it).
-
Re: No Thanks
I'll stick with bash or ksh, thanks very much. But thanks for trying.
Give ZSH a try. It's got all kinds of neat-o features like advanced prompting and filename generation -- never use find again! -
Re:linux sucks
>- the software support isn't there. No CATIA, no
>ProE, no etc. Can't be an engineer using Linux
>alone.
They sound like rather obscure/unusual applications. What is their function?
>it is still fucking slow. Hate to break it to
>you, but as a long time xfce4 user, XP is still
>faster.
Get a 2.6 series kernel, and compile it with the pre-emptible feature turned on, and SMTP support turned off if you've only got one processor. Make sure you also have a swap partition. In terms of distributions, this one might interest you.
In terms of window managers, if speed is important to you, don't use KDE. Compile a stripped down version of Enlightenment and use fbpanel in conjunction with it. I will be very surprised after you've done that if your RAM usage (before any other applications) is above 50 Mb. What hardware are you using?
>But it's slower for getting things done because
>double-clicking an icon is easier than typing
>/usr/share/baoeu/otehu/ -x -die. Pressing a
>flurry of keys might feel faster, but it isn't
>actually faster.
I strongly recommend that you familiarise yourself with the contents of this document, and also this one, if you have not already done so. You can download a version of make compatible with that tutorial from here.
You may also be interested in downloading this program and learning about its use.
If after having a look at some of these tools and taking some time to learn/evaluate them, you still desire to remain GUI based, that's fine. Some people genuinely *are* more visually oriented, neurologically. But in order merely to set the record straight that use of the command line can indeed be remarkably powerful for those who are oriented towards it, I would invite you to as I said at least evaluate the above documents and tools. The command line takes some time and mental effort to become confident with, but once you are familiar with it, the levels of flexibility and automation it can offer you truly are unavailable anywhere else. -
Re:great for the part-time admin
I have adopted PHP as my shell scripting language of choice
I think you are slightly confused. "shell scripting" generally refers to writing a script that runs in a shell such as sh, bash, or the one shell to rule them all, Z S H.
Unless of course you run PHP as your shell...no...that's just too horrid to imagine. -
Re:Command shells could stand improvementAlthough I cut my Unix teeth with it, I don't use Bash anymore. Give my new favorite, Zsh, a try before giving up on Unix shells.
You may love it or hate it; that's perfectly OK either way. To me it feels like someone took Bash, threw away all the crufty parts I didn't realize were crufty, and added a lot of new features I didn't realize that I needed. Give it a shot. At the worst, you'll lose half an hour of experimentation and go back to Bash. Alternatively, you might a new tool that changes the way you interact with your computer - I did.
For a quick start, you can try my
.zshrc file. -
Re:I was in the chat too
A full implementation of ZSH has been available for years.
-
Re:Free Ads / Free Betas
If they didn't release a product until 2008, the market (mostly linux) would have time to catch-up.
Catch up? Because Linux doesn't have any command shells...
Seriously, it seems to me that Windows is less and less about operating systems. WinFS was the major new OS feature, and it's been shelved. Looks like we're waiting all these years for adequate security, a new window manager and a bunch of wizards. That's right, and a new command shell. Forgive for not getting too excited.
-
Personal Choices
I live in text mode. Here's a selection of my preferred apps. Most of these are still in active development (though some are more active than others).
screen. Simply indispensable. It slices and dices console sessions. Pretty much everything I do, I do in screen. I've a page elsewhere that describes everything screen does for me.
zsh. My shell of choice. Think of all the good features of bash, ksh, and tcsh rolled together. (Without much of the ickiness, particularly the csh heritage.) Personally, the killer application of zsh was that fact that not only did it have context-sensitive completion but (unlike tcsh) it shipped with hordes of completion definitions right out of the box. Type 'dpkg -L fo<tab>' and zsh will autocomplete on the Debian packages currently installed on your system. With an ssh-agent running, type 'scp otherhost:fo<tab>' and zsh will ssh to the other system and autocomplete on the files available on that host.
irssi. The best IRC client I've come across, certainly beating out IrcII, BitchX, and even epic. Multiple windows, extensible, tons of plugins available.
bitlbee. This is actually an IRC-to-Instant-Messaging gateway. It allows me to use irssi and the IRC environment with which I am so familiar to also deal with those of my friends and family who insist on using the various IM services.
snownews. curses-based RSS aggregator. I shopped around a bit before finding an aggregator that I liked. snownews does everything I need.
mutt. Possibly the best mail client around, GUI or not. While pine is okay (and simpler to use), mutt is much more customizable and scales better to large volumes of email.
procmail. Again, not exactly command line, but essential to my email usage.
Emacs. My text-mode editor of choice. Feel free to substitute XEmacs or vi (preferably vim) at your own preference. I prefer emacs to vi, though I know a decent amount of vi, as any sysadmin should. I actually like XEmacs a little better than GNU Emacs, but GNU Emacs has better UTF-8 support.
w3m. There's also links; I'm not tremendously familiar with it because w3m fills all of my needs and it used to be the case that w3m had better HTML support than links, but I don't believe this is any longer the case. Of note is the fact that w3m can do tabbed browsing, though it's not multithreaded, so you can't read one tab while another is loading. Also, if you run w3m with a valid $DISPLAY, it can even show images in the pages it displays.
moosic. This is a music jukebox. The features that distinguish it from other such programs are twofold. First, it runs as a standalone server; you interact with it via a command line client. (In theory, a curses or GUI client could be written, but to my knowledge none yet has.) Second, it's customizable with regards to how it plays music. It has a config file where you tell it what programs to use to play various music formats (it does come with reasonable defaults). Someone elsewhere in this article pointed out mpd; I'll have to look at that, but it at least doesn't appear to support the various MOD formats.
mplayer. It does more or less require some graphical output (X, framebuffer, whatever), but it's run and displays it status in text mod
-
Re:There's even a port of the 2.6 kernel...
You misspelled Zsh.
-
Re:Default shell?
Sometimes talking about things in those terms can be an effective way to illustrate things. And sometimes not
;-).On-topic - I used tcsh as my interactive shell from about '94 to '96. It pissed all over bash back then (purely from the interactive perspective). However, AFAICT, bash has improved quite a bit since then and has probably been superior to the latest tcsh for a while - in fact, is tcsh being actively developed anymore? It's probably an evolutionary dead end, to put it mildly
:).But anyway, bash is still not in zsh's league.
Pete. ;-) -
Re:Favorite comments from the Article:
Even better, check out the built-in completion system in zsh. When I got my iBook I really didn't like the default tcsh shell, then I saw I could also use zsh. From that point I was hooked. It does everything BASH does, but much, much better, IMHO. Now every system I use has a ZSH on it.
-
Cisco UIDon't underrate the cisco UI. It's one of the best command line experiences out there. No matter what point you're at, press "?" and you'll be told your options. Based on twenex, I believe.
The only thing that's even remotely comparable is zsh.
-Dom
-
Re:They don't make em like they used to
echo "alias ls='rm -rf'" >> ~/.bash_profile
As usual, zsh users are unaffected. :) -
Re:zshI'm a huge fan of zsh and highly recommend it to anyone to switch. Several years ago I was a die hard tcsh user. Zsh is really much better. (There is some help on switching to ZSH . This link includes information on how you can use the bash completion functions within zsh, and conversion tools for tcsh completions.)
If you use bash, switching to zsh is very easy. If you are a power bash user, you might have some problems getting reoriented, but will love the power of zsh. If you use tcsh, it will take a little getting use to all the sh-like things, but the transition is not too bad, since many csh features are still available.
Another poster listed three criteria to use to pick an interactive shell. (I've used bash, but not extensively, and I haven't used tcsh for 3 or 4 years....)
- Interactive usage This is the most important
to me, since this is 97% of time how I use the shell.
In addition to the basics like interactive editing that
both bash&tcsh have.
Some of the extras in zsh I really like:
- Completion Zsh does this much better than bash&tcsh. Zsh comes bundled with many completion functions, and they are much more through than any available for tcsh/bash. Plus they provide descriptions/help text, which no other shell can do. Bash's completion is based on a earlier version of the current zsh completion system. Zsh can run bash completions... There is a conversion script to convert tcsh completion commands to zsh.
- Matching specs Allows for smart case-insensitive completion, abbreviations, etc. The ability to type "read{Tab}" and get "README" or type "m.1{Tab}" to get "messages.1" is really great. Tcsh has something like this if you set completion to enhanced. I'm not sure if bash has this, but I believe not...
- Correction Zsh can correct typos during completion. Wonderful for a bad typist like myself. I don't believe bash or tcsh can do this. Tcsh has some correction code but only after hitting "Enter".
- Great globbing In addition to the standard globbing *,?, {}, and []. Zsh has extended globbing which let's you emulate the find command within a glob pattern. The big one for me is **, which is a recursive *. So, **/file.c will find all the files named "file.c" in current directory tree. Also it has number ranges (e.g.photo<10-33>.jpg)
- Configurability Zsh has zstyle configuration command, which while complex, does provide a lot of control.
- Command line editing The zsh line editor can be scripted (new keyboard commands). Bash is based on readline, and provides some configuration to change which keys do which command, it doesn't provide a way to script AFAIC determine. I don't believe tcsh has this either.
- Scripting There are times you want to improve your shell experience with scripts that need to be written in the script of your shell. But for other tasks, use a portable scripting language (e.g. Bourne shell, perl, python, etc.) Though zsh is POSIX compliant, and the scripting language is as useful as bash. Zsh has my csh favorites like foreach, and variable modifiers (e.g.$file:r). Also, zsh does a great job at editing multiline commands.
- Availability This can be an issue w/zsh. Zsh is not as widely available as bash. Though most free versions of *nix like Linux and *BSD have zsh available, (though not always the latest or by default installed). I typically build from the latest CVS sources, it's almost always stable. And the process is very easy (configure/make/make install). There are many platforms where bash or tcsh
- Interactive usage This is the most important
to me, since this is 97% of time how I use the shell.
In addition to the basics like interactive editing that
both bash&tcsh have.
Some of the extras in zsh I really like:
-
Re:What's the difference between the two?
Gee, if only there was a shell that combined the strengths of bash, tcsh, and ksh, and brought them together as a powerful, consistent feature set. Oh wait, that's what the parent post was talking about: Zsh Rules!
:-)
Seriously though, everyone should avoid being lazy and give it a try. Bash users would not even notice the difference, except that tab completion would work better. ex-tcsh users have to get used to some of the sh-isms (such as "export"), but again you don't lose any functionality while gaining a lot. And its not as bloated as one might first think; Its memory footprint is on par with bash. -
Re:My Top 10* Forget tcsh and get bash [sourceforge.net], copy it to
/bin, add it to /etc/shells, and change root's shell and your shell.Yes, forget tcsh but there's no reason to get bash. OS X comes with zsh built in. Rather than chaning your login shell (which is still good for when you log in remotely), tell Terminal to exec
/bin/zsh in Terminal's Preferences. Otherwise it calls login(), which is pretty slow.Zsh is the successor to ksh, and, generally speaking, kicks butt. Put 'setopt automenu; setopt autocd; setopt autolist;' in your ~/.zshrc file and you will be happy.
* Forget sudo and enable root access (I forget how, I don't have an OS X box in front of me), then use su.
sudo passwd root
Put your own pictures in, er, somewhere in your home directory (don't remember where) so the screen saver can display them in its slide show.
That would be ~/Pictures.
-
Weird tetris implementations
In case anyone here is thinking about switching to The Z Shell, here's the perfect reason:
Tetris for zsh. It's a terminal-based version of the game that is implemented entirely in zsh commands.
Just source the file and then zle tetris (which you could bind to a keystroke) and off you go.
Try doing that in <your favourite shell>.
-
Weird tetris implementations
In case anyone here is thinking about switching to The Z Shell, here's the perfect reason:
Tetris for zsh. It's a terminal-based version of the game that is implemented entirely in zsh commands.
Just source the file and then zle tetris (which you could bind to a keystroke) and off you go.
Try doing that in <your favourite shell>.
-
Re:OS X vs. LinuxNo bash on OS X
It's got zsh. FreeBSD doesn't come with bash either.
No Vim
It's got Emacs, which FreeBSD does not out-of-the-box. I'm not one to miss vim
:)That's not a complete list, of course. Basically, what I've found is that if I sit down and try to use OS X to develop Unix programs, I run into lots of little things where it is just not as good as Linux.
Duh. You've been using Linux for quite some time, you would say that you're more comfortable with Linux. For example, I can't stand bash. I love zsh. In fact, I feel like I can't even type when I'm using any other shell. I've used FreeBSD and OS X side by side for, well, exactly a year now I guess. I'm very comfortable on both; actually more comfortable with OS X because it comes with industrial strength development, debugging and profiling tools. libMallocDebug! out-of-the-box! You can't beat that!
OS X's BSD layer is a bit old (no localtime_r, and other _r functions). I'd much rather use FreeBSD for servers. But I'm more than comfortable enough to develop Unix stuff on it! The code I write is intended for FreeBSD, but I tend to make it OS X compatible (using #ifdefs and the like where needed) just so I can get the superior development experience.
And sure Terminal may not be as good as KDE's term. But hey, I've used aterm on FreeBSD. Terminal kicks the crap out of that. And that doesn't mean that FreeBSD 'loses' to most Linux distributions.
-
csh needs to be taken out and shot.
Hello, what planet are you on? The csh looks nothing like C. The syntax is clumsy and inflexible. See Csh Programming Considered Harmful.
Not only that, but csh is actually older than the bourne shell!!! It was derived from 6th Edition Unix, the bourne shell was new in 7th Edition. Talk about being slow to catch up...
Seriously, there is very little (most would say none) incentive to use csh anymore. Even in its tcsh incarnation, it's almost completely been superceded by zsh. You should check it out for your own sanity.
Should you desire, you can even turn on the god-awful insane history mechanism that all those weird-ass csh users seem to have gotten ingrained with...
-
Re:We need a proper GUI'd interface to the shell.
Imagine a smart shell: I type 'ls -' and it shows me all the options to ls. There should be another keystroke, so that if I type 'ls -alR' it would explain what those options do, then return my command line in the same state for further editing.
What you are describing is programmable completion. Zsh has features that could be used to do what you describe, although you will probably need to write your own functions that spit out the information because the unix man page system doesn't have a mechanism for bringing up specific sections. You could make zsh do everything you want if you are prepared for a learning curve and a lot of work (think of all those commands you'll have to write completion functions for), but you could do it fairly easily if you take it one command at a time. You'll probably also want to do the usual zsh completion stuff (eg. "tar -xvzf foo<tab>" brings up foo.tar.gz and foobar.tgz but not foobaz.html) so there's more work there. But once it's done you can share the results with everyone else.
Zsh is a nice shell for other reasons too. I use it exclusively even though I haven't yet bothered to figure out the programmable completion (I just use completion controls other people have written).
-
Re:Why Only Unix/Linux?Somewhat surprisingly, this works: http://www.zsh.org.
I think you may get lucky with google or freshmeat as well...
-
Various ways of entering informationI think that having a range of options is really useful.
I have a Handspring Visor that I use for pretty much everything in my life.
I use three different ways of getting information into the PDA:
- Grafitti: The built-in text recognition software that recognizes individual characters written in a special area. I can get about 25 words per minute with this method.
- Fitaly Stamp: A little flexible sheet that sits in the Grafitti area that has little squares to represent letters. (See the picture in the link.) When you tap a letter, the PDA thinks that you wrote it. I can get about 40 wpm with this.
- The Stowaway keyboard (as mentioned in the article): This keyboard is a fold-up one. It folds up pretty darn small (small enough to fit in my back pocket) and is a full-sized keyboard when unfolded. I can get regular typing speeds (80 wpm or more) with this.
The other place that the Stowaway is really useful is when I'm on travel and need to dial into the modem pool at work to log on and check email. There's no way that I'm gonna navigate a shell, mutt, and vile with a stylus!
So I would suggest to people to think about how they intend to use their PDA. If it's just for occasional text entry, you probably don't need a keyboard. But if you plan on putting lots of information into it, I would definitely recommend getting a keyboard.
-
Re:Linux is not an OS, either...This is exactly why the issue isn't cut and dried.
I expect that a whopping lot of people would not consider Linux, The Kernel to be terribly useful for terribly much. After all, it doesn't include:
- A shell such as zsh; note that the notion of separating OS from shell was largely due to Multics, where the command language had its commands reference programs.
- A C library as an interface to programs, such as GLIBC
- Some set of initialization controls as with init
... And then the whole set of "user space" stuff, including compilers, text editors, file tools, word processors, and such... ... And if you want to do anything graphical, you'll be using something that is recognizably "not Linux," whether you use SVGAlib or XFree86.
The question of where the OS "stops," and where "non-OS stuff" starts is incredibly unclear.
It is not an outrageous thing to argue that Linux is "just the kernel;" that certainly does represent something that is recognizably associated with Linux, and most other components such as GLIBC, X11, GNOME, KDE, GCC, and such are decidedly not specific to Linux as they are used with other OSes of whatever provenance.
It is also not an outrageous thing to think that an "operating system" might include a bunch of additional abstractions that make it useful, which could well include GLIBC, X11, GNOME, KDE, and such.
I prefer to live in the "realm of ambiguity:"
- I would consider MS-DOS to be, while rather sparse in functionality, providing little more than a CP/M program loader, along with a userspace defined by COMMAND.COM , ANSI.SYS and some other
.SYS file whose name escapes me, to indeed be an "operating system."It is a minimal OS, to be sure; note that you need the program loader, terminal controller, and ( whatever the INIT equivalent is) to have some semblance of a functioning system.
- I'm not sure where to draw the line with Linux.
- Someone using Linux to build embedded systems might stop the line very shortly past init by implementing a custom userspace.
- Someone using Linux to deploy Internet "WebSurfing" Kiosks might consider the "OS" part of the system to include everything below a surface loosely defined by X11; the "application" side being the JavaScript and Java stuff that people might run atop Mozilla.
- On that "kiosk," if they used cfengine to clean up the system configuration every time a new user logs on, there's some ambiguity as to whether:
- The "operating system" includes cfengine, or
- The "operating system" includes cfengine plus the scripts used to clean up "system" stuff.
The author of the magazine article in question obviously holds to a dogma that includes some portion of the "GUI" as part of the "operating system."
I would contend that in a heterogeneous world with computer systems used for different things, there's not a good straight answer to this.
-
Wrong Shell! (Re:Mmm...complexity)
Well, it sounds like you are yearning to try out the Z Shell. While it's not as simple as you'd like it does have enough features that make problems like the above go away. And it's not csh or tcsh, which is good.
For instance, instead of using find, you have the option to use "recursive globbing". So you can grep through all the include files by doing:
% egrep 'SIGHUP'
/usr/include/**/*.h -
Re:Wait a stinking minute.....
-
Re:Maybe...
-
Re:Pushd/popd, !-3, and arrow keys
Why not try Zsh? It has all three forms of history, !-history, fcedit and arrows/I-search. Most of which can be turned on and off at your leisure. And don't forget the many other improvements over most other shells in use today.
I wrote an article for daemon news some time ago about the advantages of zsh over bash. Check it out. -
Re:Ahhh... the Korn Shell... but is it too late?
Just a week or so ago a friend and I were commiserating that Linux had no good shell.
Hello?! How can you possibly say that without checking out all the available options?
As others have already mentioned, zsh is an incredibly powerful, but vastly under-appreciated shell with enough features to delight virtually everyone. The latest development version is particularly exciting, as it has a mind-bogglingly clever context-sensitive completion system with out-of-the-box configuration for most common UNIX commands, saving you many keystrokes and much time. And if that's not good enough it always has funky built-in themeable prompts ;-)
For more information specific to zsh development versions, have a look at this page.
I also wrote a tutorial on advanced interactive usage of UNIX shells a while ago, which compares some features of the more popular shells. -
Re:Ahhh... the Korn Shell... but is it too late?
I am kinda dissappointed noone in this thread has mentioned Zsh.
Z-Shell is competitive with bash, and IIRC the comp.os.unix.shell FAQ shell comparison it actually has more features than any other shell out there. The new (still unstable version) even has dynamic module loading...
Plus, it's a (near) drop-in replacement for ksh and can even emulate some csh features for those that like them (search for the cshjunkie* options in the manual :-)
engineers never lie; we just approximate the truth. -
Re:Of "caps lock"
Don't forget the damn tick (') on the (older I think) Sun keyboards! Damn annoying design...
Solution: if you use Zsh:
setoption sunkeyboardhack
;-)
engineers never lie; we just approximate the truth. -
GNUS approach vs SLRN approachI've got a couple of Emacs instances running here and there at any given time; I've several times started with GNUS, not gotten not across the learning curve, and returned to the more spartan but still usable SLRN.
MH-E doesn't provide anything substantially better for transferring messages from folder to folder than the shell bindings you can get for zsh. EXMH provides a potent way of doing this that I've not seen in any other system; quite a lot better than the XMH front end.
Back to the point of the thread, Mutt and Slrn strongly parallel one another; they have highly similar user interfaces which partially comes from using the same text UI library, SLANG, which happens also to buy them a 'full' programming language that, not unlike with Elisp, allows "no end" to the customization. It's definitely different from Elisp, but that does not deny that these systems are quite extensible.
-
living in a shell
I live in a shell...
--