From: Tero Niemela <tero_niemela@yahoo.com>
To: zsh-users@sunsite.dk
Subject: Re: Two simple questions
Date: Tue, 14 Sep 2004 09:37:58 -0700 (PDT) [thread overview]
Message-ID: <20040914163758.80589.qmail@web61310.mail.yahoo.com> (raw)
In-Reply-To: <20040913211024.GA31504@DervishD>
Hi!
> > 0) I'm seeing dirs like /bin /bin/ and even /bin//
> in
> > my PATH.
>
> 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.
In some cases (Cygwin) it indeed does have spaces.
However, your solution seems not to be optiomal:
~> export PATH=/bin:/usr/bin:/bin//:/bin/
~> which ls
/bin/ls
~> path=(${(qq)${path//\/##/\/}%/})
~> echo $PATH
'/bin':'/usr/bin':'/bin/'
~> which ls
ls not found
zsh: exit 1
~>
> > 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.
I did the following, works perfectly for me:
Last line of ~/.zlogin is:
[[ "$OSTYPE" = *cygwin* && $ARGC -eq 1 ]] && cd "$@"
And this registry settings was added to Windows
registry:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\command]
@="Cygwin Here"
[HKEY_CLASSES_ROOT\Folder\shell\command\command]
@="\"C:\\cygwin\\bin\\zsh.exe\" -l -s \"%1\""
Thanks!
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
next prev parent reply other threads:[~2004-09-14 16:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-13 15:52 Tero Niemela
2004-09-13 18:57 ` Björn Lindström
2004-09-13 21:10 ` DervishD
2004-09-14 16:37 ` Tero Niemela [this message]
2004-09-14 17:19 ` DervishD
2004-09-14 18:55 ` Tero Niemela
2004-09-14 19:09 ` DervishD
2004-09-15 5:11 ` Tero Niemela
2004-09-15 8:36 ` DervishD
2004-09-15 10:29 ` Stephane Chazelas
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=20040914163758.80589.qmail@web61310.mail.yahoo.com \
--to=tero_niemela@yahoo.com \
--cc=zsh-users@sunsite.dk \
/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).