From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10436 invoked from network); 6 Jan 2000 08:40:29 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jan 2000 08:40:29 -0000 Received: (qmail 11951 invoked by alias); 6 Jan 2000 08:40:16 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2832 Received: (qmail 11944 invoked from network); 6 Jan 2000 08:40:13 -0000 Date: Thu, 6 Jan 2000 19:44:32 +1100 From: Andre Pang To: zsh-users@sunsite.auc.dk Subject: Prompt expansion, multi-job for Message-ID: <20000106194432.A488@bozar.ihug.com.au> Reply-To: Andre Pang Mail-Followup-To: zsh-users@sunsite.auc.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Sender: andrep@vjolnir.org Hiya guys, I've got two completely separate questions about zsh. 1) Let's say I'm in the /usr/local/src path at the moment. Normally, if you use the %~ prompt expansion, it will expand to /usr/local/src - no surprises there. What I'd like to do is trim each path element to one character unless it's the last path element, in which case it should be displayed to a maximum of, say, 15 characters. eg, /usr/local/src should be displayed as "/u/l/src", /usr/local/src/linux would be displayed as "/u/l/s/linux", and /usr/local/src/linux-2.2.14+reiserfs+raid+ide might be displayed as "/u/l/s/linux-2.2.14...". Is this possible with the current prompt expansion codes, or will I have to write up a function to do it, if it's possible to do at all? 2) Is there any way to emulate make's -jn option in the for command? This would be *really* useful for SMP systems. Currently, doing something like "for i in ***/***.wav; do l3enc $i; done" doesn't take advantage of multiple CPUs (on a Linux system, at least); hacking the for command to accept a 'make -j'-like parameter (eg: for -j2 i in *; do l3enc $i; done) would allow us lucky ones who have SMP systems to do many things similar to the above without going mad and writing silly Makefiles simply so we can utilise make -j. If someone's written a function to do this already (Bart? ;) it'd be *very* cool. Thanks, -- : Andre Pang - Purruna Pty Ltd - ph# 0411.882299 : : #ozone - http://www.vjolnir.org/ozone/ :