From: Quinn Dunkan <quinn@envy.ugcs.caltech.edu>
To: zsh-users@math.gatech.edu
Subject: ideas
Date: Wed, 18 Mar 1998 00:03:26 -0800 [thread overview]
Message-ID: <199803180803.AAA00183@tammananny.tiger> (raw)
Here are a few ideas for new zsh features. It may be that it is already
possible to do these things with existing features, if so I'd love to know
how.
${...#...} and ${...%...} chop things off the begginning or ends of variables,
and I've wondered why there isn't something like ${i:s/foo/bar} to replace foo
in $i with bar. With ${(S)...%...} one can chop things out of the center of a
variable, but what if you want to replace it with soething else? Actually, it
would be even better if you could put in a regexp. Regexps in the [[ ]]
construct would be nice too---"if echo $blah | grep -q; then..." is kind of
clumsy. I've written some really ugly perl scripts that would have been much
nicer in shell, but weren't because no shell I know of has very powerful string
handling.
In HPUX, you can chase symlinks by sticking a / on the end of them, even if
they're not directories. Example:
% touch a
% ln -s a b
% ls -F
a
b@
% rm b/
% ls
a
%
Other OSs don't do this, and even in zsh, something like:
% ls -l =latex
lrwxrwxrwx 1 root tex 7 Aug 14 1997 /usr/local/lib/texmf/bin/latex -> latex2e
% ls -l =latex/
lrwxrwxrwx 1 root tex 6 Aug 14 1997 /usr/local/lib/texmf/bin/latex2e -> virtex
% ls -l =latex//
-rwxr-xr-x 1 root tex 198196 Dec 7 1996 /usr/local/lib/texmf/bin/virtex
won't work because zsh doesn't know about it, and you can't resolve them with
tab. Even though it's an operating system feature, I see know reason why the
shell couldn't do it too.
next reply other threads:[~1998-03-18 8:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-03-18 8:03 Quinn Dunkan [this message]
1998-03-18 14:57 ` ideas Christopher Craig
1998-03-18 17:14 ` ideas Bernd Eggink
1998-03-18 17:51 ` ideas Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199803180803.AAA00183@tammananny.tiger \
--to=quinn@envy.ugcs.caltech.edu \
--cc=zsh-users@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).