TextMate News

Anything vaguely related to TextMate and macOS.

From Bash to Z Shell

From Bash to Z Shell Book Cover

If your usage of Mac OS X is the slightest bit “technical” then you should do yourself the favor of getting familiar with the extremely powerful shell environment.

Even if you already know a dozen scripting languages far more expressive than the shell, there are still contexts in which the shell is just better suited for the job, and understanding the POSIX environment is knowledge that is very valuable even outside the shell.

James Edward Gray has a review of From Bash to Z Shell which sounds like just the book you want to pick up, quoting from his review:

I’ve already noticed dramatic differences. I’m using shell loops at the command-line now to process many files at once; I actually understand shell quoting and when to use which types of quotes and escapes to get the desired effect; I can easily strip off a file extension or get a directory name from a full path when I need one; I make constant use of the command history now whether I’m searching for a past command, correcting a typo, or just pulling a single argument out of a previous command for reuse in a new command; and I’ve written a few shell functions to provide shortcuts to my common tasks.

categories General

9 Comments

Funny, I already do all that in bash.

Just to clarify, the book title is (likely) meant as “Looking at shells from Bash to Z Shell” rather than (the more direct interpretation) “Migrating from Bash to Z Shell” (hence Kevin’s comment above).

Allan is right. The book is (mostly) applicable to both bash and zsh. I think the last two chapters are about writing your own completion, and zsh really takes over there. But you should take a look at zsh anyway. I don’t know what I’d do without recursive globbing these days. And the completion completely rocks.

Aside from that, the book is well written and a good way to get to know your shell better.

14 February 2008

by Andrey Tarantsov

I’m using zsh daily because it can merge histories from multiple session. Also I like the powerful completion. Other than that, I have a config that makes zsh look and behave mostly as bash.

05 March 2008

by Darryl Zurn

I ♥ zsh

05 March 2008

by Darryl Zurn

Oops, let’s try again:

I ♥ (love) zsh. I especially love the command completion, history, and the prompting abilities.

There’s some great thinking behind this, and it’s the first and only shell I’ve really learned. It’s syntax makes a lot more sense, and it’s actively supported so that helps a lot finding who else has run into problems.

I’ve made some zsh-specific textmate functions and bundles if anyone is interested:

http://xanana.ucsc.edu/xtal/textmate_iterm.html

Although I am using the shell almost always, the book is a benefit to me. I’d just recommend that you act more careful when working in the shell, because it’s much easier to bash everything.

If you want to try zshell you should get the configuration that the zshell-lovers provide at http://grml.org/zsh/

Just install or update their configuration with a simple

wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc

in your home directory and you can instantly enjoy loads of thoughtfull featues that you don’t have to customize yourself.

For example in svn/hg/git/bzr projects the prompt shows the revision / branch you are on or if your workspace has conflicts.

Very, very handy.