From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7414 invoked from network); 3 Mar 2000 23:07:52 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Mar 2000 23:07:52 -0000 Received: (qmail 25634 invoked by alias); 3 Mar 2000 23:07:30 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2938 Received: (qmail 25619 invoked from network); 3 Mar 2000 23:07:29 -0000 From: Bruce Stephens To: zsh-users@sunsite.auc.dk Subject: Re: zsh tips for "UNIX Power Tools" References: <28174.952013581@jpeek.com> <20000303123932.A11036@picard.franken.de> Date: 03 Mar 2000 23:05:42 +0000 In-Reply-To: Thomas=?iso-8859-1?q?_K=F6hler's?= message of "Fri, 3 Mar 2000 12:39:32 +0100" Message-ID: <87k8jjwt6h.fsf@cenderis.demon.co.uk> User-Agent: Gnus/5.0804 (Gnus v5.8.4) XEmacs/21.2 (Iris) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: bruce@cenderis.demon.co.uk Thomas K=F6hler writes: [...] > And this one: > chmod 755 **/*(/) > chmod 644 **/*(.) > Hey, all directories are mode 755, while all plain files are mode 6= 44! > Again, no find is necessary, as would be for bash: > find . -type d -exec chmod 755 {} \; > find . -type f -exec chmod 644 {} \; What's wrong with chmod -R go+rX . However, wacky globbing is probably the thing that's special to zsh that I consciously use. OK, completion, too. For example, a colleague was using some inferior shell (bash, I think) and having to do things like: find . -type f -print | xargs grep -l ... (It's painful to watch, sometimes.) In zsh (for reasonably sized trees, which I find are pretty common, YMMV): "grep -l ... **/*(.)".=20= =20 Yes, you can write little shell-scripts to do find ... | xargs, but ** (or ***) is just so much more convenient. VMS had the right idea, there. Which of the directories is biggest? "du -sk *(/)" Which file has changed in the last couple of days? "echo *(m-2)" And so on. There are lots of really fancy things that zsh can do, but I tend not to be able to remember them. Simple stuff like the above make it worthwhile to use, however, and the necessary syntax is very easy to remember. The stat dynamically loadable module is convenient for those operating systems which don't have a stat executable. I find these convenient: setopt autocd setopt autopushcd I find this nice, but it's mostly cosmetic (path on the left is OK, too= ): RPROMPT=3D"%~" The built-in completion is excellent (that is, the scripts that are supplied with 3.1.6-dev-18). Peter Stephenson's guide to it shows a number of nice tricks to changing its behaviour. > - setopt rmstarsilent > (I don't like this > "sure you want to delete all the files in /home/jean-luc/foooooooo= [yn]?" > ) Matter of taste. I like it. [...] > - Why not simply use ^Xh instead of ^X^H? Now, I have a feature of > zsh-3.1.6-dev-xx on ^Xh: > bindkey "^Xh" _complete_help Why not use M-h, which is built-in, I think. I don't remember configuring it, anyway. [...]