From Bash To Z Shell
A *nix-style shell is available on a number of platforms, so the authors chose not to limit themselves to just one, such as Linux. The techniques they discuss can be used in Unix, as well as under Windows using cygwin.
In case you're not overly well-versed in shell handling, the first part of the book does a pretty good job covering all of the things a typical user might want to do. Basic command editing, I/O redirection, jobs, processes, and some simple scripting are all covered. For many users, this is also as far as they would like to go. However, reading a little further yields treasure.
The next part delves into bash version 3.0 and zsh version 4.2, both freely available on the Internet. In addition to more sophisticated command line editing techniques, the authors also delve into the misty realms of re-binding keys. A great many users find themselves typing the same sequences over and over again. While sometimes a script makes sense to encapsulate these sequences, sometimes you want to simply enter some text and that's where a key binding makes sense. One example given in the book for zsh is bindkey -s '\C-xt' 'March 2004\eb' . After the binding, typing CTRL-x t puts the string 'March 2004' onto the command line, and moves the cursor under the '2' so you can insert the day of the month. That's a very simple example for a very powerful facility. A good chunk of chapter 4 is spent on showing how to make the most of bindkey (or its bash cousin 'bind').
The next few chapters cover common topics of prompt strings, file/directory globbing, and shell history. Then, significant press is given to the subject of pattern matching. Many people understand basic pattern matching and regular expressions, but From Bash to Z Shell goes into careful detail, with many examples from both bash and zsh, to contrast the (minor) differences between these two powerful shells. The next chapter discusses command line and file/directory name completion, a topic usually glossed over in other texts. Finally, job processing wraps up Part 2.
The third and final part of the book deals with extending the shell using variables, scripts, and functions. Here's where we get into the nitty-gritty. The first two chapters go over familiar territory: shell variables and shell programming. The chapter on programming is easy to follow, and I suggest you try the examples as you go to get the most out of it. The last two chapters focus on topics frequently overlooked: editor functions, and completion functions. Editor functions allow you (with bind[key]) to define new capabilities to use while editing the command line. This is where a true power user can shine, creating a suite of new functions to speed his/her use of zsh or bash. Completion functions work in defining new ways for the shell to complete a command, file name, or directory, based on a user-written function. Honestly, it's not something I would tend to use, but the capability is intriguing.
All in all, From Bash to Z Shell provides a frequent shell user with a plethora of new insights into customizing the bash and zsh shell programs to fit his/her tastes. The authors have filled a void in tackling the subject of customizing the shell rather than just simply using it. I would have liked to see more coverage of some of the more standard uses of the shells, just so the book could be a more complete reference, rather than the specialized one it is. Specialized or not, there is a lot offered here, and you couldn't go wrong getting this book.
You can purchase From Bash to Z Shell: Conquering the Command Line from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I think either shell mentioned in the book is great, I personally use
bash, mostly just because of historical reasons.
Speaking of different shells in general. Here is a very handy list
that can help you pick which shell is best for you. This is not meant
to start a war over which shell is better but is just meant to help
pick the shell that is best for you:
http://www.unix.com/showthread.php?t=12274
Just thought it would be helpful.
--greg Vulcan quiescent... Q: What machine shutdown with this message?
Unix shells by example. Just enough in-depth for my taste. Full of tricks you actually will remember, and if you don't remember the exact syntax it can be quickly found in the book again (which I occasionally/often have to do... Kudos to those that can write commands with multiple single and double quotes in one go :-) ).
The book is mostly on bash, and c-shell.
Please login to access my lawn
I still can't figure out why the Irix bootloader is called SASH, which means the standalone shell... it would make you think it lets you do unix like things without Irix booted, but nooooo it uses the same syntax and commands even as the PROM monitor uses, except sash can read XFS volumes unlike the boot PROM and list the contents of directories.
I'm friends with the youngest daughter of the former head of the PowerPC division of IBM you insensitive clod!
Short answer: Yes
Long answer: I don't think most tcsh users use it for its programming ability. Instead, it tends to be useful as a solid interactive shell. Its general "feel" tends to be more solid than bash, owing partly to the fact that bash has a lot of built in key-shortcuts that tcsh doesn't. Of course, once you're used to being able to double tab for a directory listing, it's kind of hard to give up.
Javascript + Nintendo DSi = DSiCade
Technically that's not right either because ash is the Adventure Shell!
Ummm... no. That would be a different thing. Ash is the Almquist Shell, an open source replacement for /bin/sh (the bourne shell).
Javascript + Nintendo DSi = DSiCade
that kind of tab completion exists in tcsh too - just toss set autolist in your .cshrc file. I had it enabled on my last freebsd install - basically makes tcsh work exactly like bash while still feeling more solid. Silly linux kids, when will they learn?!
IIRC, the standard is:
1 44 589.htmli /Colour-ls
Directories are bold
Links are italic
I think there were also underlines for something, but hell if I can remember what.
Here's some links to help you on your way:
http://www.webservertalk.com/archive109-2004-3-
http://sunsite.nus.sg/pub/LDP/HOWTO/min
Javascript + Nintendo DSi = DSiCade
I think both zsh and bash could use a redesign. The syntax is crufty, with stupid variable assignment syntax ('foo = bar' is not the same thing as 'foo=bar'? '$foo' is not the same thing as `$foo` or "$foo"?), insufficient tab-completion support and very few features enabled by default.
I have written a shell called fish. It has lots of new features. Check it out.
</shameless plug>
Try out fish, the friendly interactive shell.
except, if you'd read the article, you would have noticed that the author only covers bash and zsh. Ash is given but a cursory glance.
If I'm thrown into a shell I don't like, I just type "bash"<enter> and that's that. If the students can't figure that one out, they really are screwed.
What a timesaver! I start so many commands withIn all seriousness, though, I'd like to stick my suggestion in here: Wicked Cool Shell Scripts is a charming little read and the scripts are all on line!
grammar-lesson free since 1999. (rescinded - 2005)
In bash (and ksh) I hit ESC to enter command mode, then v to bring up (v)isual mode. Perhaps zsh is similar? HTH.
bindkey "\ee" edit-command-line
bindkey "\Me" edit-command-line
Thats Escape-e and Meta-e.
edit-command-line should bring up the current commandline in the program $FCEDIT.
I set FCEDIT=vim.
Colors? Fonts? Feh. You kids and your fancy terminals.
The "standard" is to alias ls to 'ls -F'. This appends * to executables, / to directories, @ to symlinks, = for sockets, and | for FIFOs. Works on any terminal.
Tom Swiss | the infamous tms | my blog
You cannot wash away blood with blood
Perhaps I'm evil, not supporting bn.com but, it's a massive difference in price - cheap enough to pick up casually.
Someday we'll all be negroes
Isn't that Bourne Again SHell?
when I first encountered it nearly two decades ago, it was installed as "ash".
If you're referring to the original script version as opposed to the C port, then the shell name was "ash.sh". Someone might have copied or symlinked it to just "ash" on your system. Here's the original Adventure Shell from Usenet. Note the 1987 timestamp.
Javascript + Nintendo DSi = DSiCade