From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28036 invoked from network); 18 Mar 1998 08:24:37 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 18 Mar 1998 08:24:37 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id DAA24411; Wed, 18 Mar 1998 03:07:33 -0500 (EST) Resent-Date: Wed, 18 Mar 1998 03:07:13 -0500 (EST) Message-Id: <199803180803.AAA00183@tammananny.tiger> To: zsh-users@math.gatech.edu Subject: ideas Date: Wed, 18 Mar 1998 00:03:26 -0800 From: Quinn Dunkan Resent-Message-ID: <"WG1S31.0.Vy5.m2u3r"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1393 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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.