zsh-users
 help / color / mirror / code / Atom feed
* Prompt expansion, multi-job for
@ 2000-01-06  8:44 Andre Pang
  2000-01-06 12:03 ` Oliver Kiddle
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Andre Pang @ 2000-01-06  8:44 UTC (permalink / raw)
  To: zsh-users

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 <andrep@vjolnir.org> - Purruna Pty Ltd - ph# 0411.882299 :
:               #ozone - http://www.vjolnir.org/ozone/                :


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Prompt expansion, multi-job for
@ 2000-01-06 11:41 Sven Wischnowsky
  0 siblings, 0 replies; 11+ messages in thread
From: Sven Wischnowsky @ 2000-01-06 11:41 UTC (permalink / raw)
  To: zsh-users


Andre Pang wrote:

> 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?

Not built-in. But you can always do any calculation you need in the
precmd function, stuff the result in the psvar array and use %v (or
any parameter if you use PROMPT_SUBST).


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2000-01-09  1:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-06  8:44 Prompt expansion, multi-job for Andre Pang
2000-01-06 12:03 ` Oliver Kiddle
2000-01-06 14:19   ` Thomas Köhler
2000-01-06 15:21     ` Oliver Kiddle
     [not found]       ` <14452.47479.5744.410474@gargle.gargle.HOWL>
2000-01-06 17:47         ` Oliver Kiddle
2000-01-09  0:59       ` Bart Schaefer
2000-01-06 14:54   ` Andre Pang
2000-01-06 12:44 ` Andrej Borsenkow
2000-01-06 14:46   ` Andre Pang
2000-01-06 20:18 ` Peter Stephenson
2000-01-06 11:41 Sven Wischnowsky

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).