Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Two simple questions
- X-seq: zsh-users 7985
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Tero Niemela <tero_niemela@xxxxxxxxx>
- Subject: Re: Two simple questions
- Date: Mon, 13 Sep 2004 23:10:24 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20040913155253.56857.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Tero Niemela <tero_niemela@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: DervishD
- References: <20040913155253.56857.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Hi Tero :)
* Tero Niemela <tero_niemela@xxxxxxxxx> dixit:
> 0) I'm seeing dirs like /bin /bin/ and even /bin// in
> my PATH. What would be the best way to clean up the
> trailing slashes? "typeset -U path" won't clean up
> paths if they have different number of trailing
> slashes (I mean all those mentioned paths are left but
> other instances of, e.g., /bin are of course cleaned).
'typeset -U' just 'uniqize', it doesn't normalize. You're looking
for something like (EXTENDED_GLOB must be set, for the '#'):
path=(${(qq)${path//\/##/\/}%/})
This converts multiple slashes to just one, and then removes the
last one. The '(qq)' part is needed just in case 'path' has elements
with spaces in it.
> 1) I use cygwin+zsh and it works great. I have in my
> windows explorer "Command prompt here" option that
> starts cmd.exe in the selected directory (with
> "cmd.exe /k 'cd %1'" or something). How could I define
> a command in command line that gets executed after all
> zsh configuration files? zsh && cd /some/path of
> course doesn't work.
Just add that command at the end of the last config file read. If
the shell is interactive, try /etc/zshrc (well, I don't know which
name it has under cygwin, sorry).
Hope that helps :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author