Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Two simple questions



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 



Messages sorted by: Reverse Date, Date, Thread, Author