zsh-users
 help / color / mirror / code / Atom feed
* RE: zsh for win32 - installation of zshrc
@ 1998-09-16 23:08 Amol Deshpande
  0 siblings, 0 replies; 28+ messages in thread
From: Amol Deshpande @ 1998-09-16 23:08 UTC (permalink / raw)
  To: zsh-users, 'Bart Schaefer'

i put in code to hash foo.exe as foo as well as foo.exe

bogus corrections should be reduced a bit by this.

(check for version 0.50)
thanks,
-amol

> ----------
> From: 	Bart Schaefer[SMTP:schaefer@brasslantern.com]
> Sent: 	Tuesday, September 15, 1998 5:55 PM
> To: 	zsh-users@math.gatech.edu
> Subject: 	Re: zsh for win32 - installation of zshrc
> 
> On Sep 15,  2:56pm, Amol Deshpande wrote:
> > > 
> > > "setopt correct" is worthless because it uses the full file name (e.g.
> > > "foo.exe") when trying to correct the spelling of a command ("foo")
> and
> > > therefore complains about nearly everything except builtins.  (This is
> > > probably fixable by playing with hash/unhash commands.)
> > > 
> > it's actually fixable by just renaming all your foo.exes to foo :-)
> 
> I wrote this little fragment of code to fix it (still not handling all
> the possible extensions, just .exe):
> 
> function fixhash {
>   emulate -R zsh
>   setopt localoptions
>   local hashed exe
>   hash -f
>   eval hashed=\( $(hash) \)
>   exe=( ${(M)hashed:#*.[Ee][Xx][Ee]\=*} )
>   hashed=( ${hashed%%\=*} )
>   hashed=( ${hashed:#*.[Ee][Xx][Ee]} )
>   hashed=( ${(M)hashed:#*.*} )
>   [[ $#hashed -gt 0 ]] && unhash $hashed
>   [[ $#exe -gt 0 ]] && hash ${exe:l:s/.exe//}
> }
> 
> However, running that function takes a LONG time and then crashes the
> shell.
> Right before the shell crashes, the $hashed array is 1349 elements long
> and
> contains just over 16000 bytes.
> 
> If I don't put the commands in a function, simply type everything from the
> "hash -f" to the end directly at the PS1 prompt (or put it in .zshrc),
> then
> it still takes a long time -- particularly "eval hashed=\( $(hash) \)" --
> but the shell doesn't crash.
> 
> > For example,  HOMDRIVE=F:,  and HOMEPATH=\
> > so, if  FOO=$HOMEDRIVE$HOMEPATH,  then FOO is set
> > to F:\.
> > 
> > this will confuse the shell no end (all paths MUST be '/'-delimited)
> 
> Hmm, that's interesting.  Right now I have HOME=d:\home\schaefer and I
> don't have winntconvertbackslash and the shell seems to be doing fine.
> (Everything in $PATH is forward-slash-delimited, though.)
> 
> > in tcsh i could just do
> > 
> > set bar=$var:s#\\#/#:ah  
> > 
> > but I was told there was no simple way in zsh to do the same.
> 
> bar=${var:gs@\\@/@}
> 
> works fine.  Going the other way is trickier:
> 
> var=${bar:gs@/@\\\\@}
> 
> I don't know why the extra two backslashes are needed.  Anyone?
> 
> > BTW, please don't cc amol@blarg.net.
> 
> Sorry; my UA copied the Cc: from your own headers.  (I've been deleting
> amold@microsoft.com from the To: header by hand).
> 


^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: zsh for win32 - installation of zshrc
@ 1998-09-15 21:56 Amol Deshpande
  1998-09-16  0:55 ` Bart Schaefer
  0 siblings, 1 reply; 28+ messages in thread
From: Amol Deshpande @ 1998-09-15 21:56 UTC (permalink / raw)
  To: ZShell Users List, 'Bart Schaefer'

> ----------
> From: 	Bart Schaefer[SMTP:schaefer@brasslantern.com]
> Sent: 	Tuesday, September 15, 1998 1:59 PM
> To: 	ZShell Users List
> Cc: 	amol@blarg.net
> Subject: 	Re: zsh for win32 - installation of zshrc
> 
> 
> "setopt correct" is worthless because it uses the full file name (e.g.
> "foo.exe") when trying to correct the spelling of a command ("foo") and
> therefore complains about nearly everything except builtins.  (This is
> probably fixable by playing with hash/unhash commands.)
> 
it's actually fixable by just renaming all your foo.exes to foo :-)
i thought it would be a waste of time for the shell to try all possible
extensions (.exe, .com, .bat, .cmd) for each command, so i didn't bother
to fix this. 

> "setopt winnt_ignore_case winnt_lame_path_fix" seems to be a pretty good
> idea.  I'm not sure exactly when "winnt_convert_backslash" is important.
> 
you probaby need it in cases where you are deriving paths from other DOS
style paths.
For example,  HOMDRIVE=F:,  and HOMEPATH=\
so, if  FOO=$HOMEDRIVE$HOMEPATH,  then FOO is set
to F:\.

this will confuse the shell no end (all paths MUST be '/'-delimited)
if you set winntconvertbackslash, the theory is that the shell converts
'\' to '/' when matching paths.

in tcsh i could just do 

set bar=$var:s#\\#/#:ah  

to convert '\' to '/' before
assignment, but I was told there was no simple way in zsh to do the
same.

BTW, please don't cc amol@blarg.net. I am a member of this mailing list.

thanks,
-amol


^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: zsh for win32 - installation of zshrc
@ 1998-09-15 18:04 Amol Deshpande
  0 siblings, 0 replies; 28+ messages in thread
From: Amol Deshpande @ 1998-09-15 18:04 UTC (permalink / raw)
  To: ZShell Users List, 'Bart Schaefer'

by the way, you may find that if a user starts up zsh from another
drive, the shell will not find /etc/zshenv.

> ----------
> From: 	Bart Schaefer[SMTP:schaefer@brasslantern.com]
> Sent: 	Tuesday, September 15, 1998 10:18 AM
> To: 	ZShell Users List
> Cc: 	amol@blarg.net
> Subject: 	Re: zsh for win32 - installation of zshrc
> 
> On Sep 14,  7:55pm, 'Sven Guckes' wrote:
> } Subject: Re: zsh for win32 - installation of zshrc
> }
> } Quoting Bart Schaefer (schaefer@brasslantern.com):
> } > zagzig[21] zcat zsh.exe.gz | strings -a | less +/zshrc
> } 
> } Actually, I tried just that - but I figured that it would not work
> } as there is no directories /etc on Windows systems.  :-/
> 
> There is, however, a mkdir command ...
> 
> On Sep 15,  1:53am, 'Sven Guckes' wrote:
> } Subject: Re: zsh for win32 - installation of zshrc
> }
> } And I always thought that the value of a variable on the DOS shell
> } is "%var%" and not "$var".  or has this changed with WindowsNT?
> 
> It's a property of the shell (or rather, of command.com) not of the OS.
> So yes, if you were running a DOS batch file, you would use %var%.
> In zsh scripts, however, it's zsh that interprets the syntax, just as
> it does on unix, so you use $var.
> 
> } The value of a variable on Windows cannot be used as $VAR (I think)
> } but needs to be specified as %VAR% - and this is only possible in batch
> } files.  Right or wrong?
> 
> Mostly wrong.
> 
> If what you want to do is set the variables for all Windows apps, e.g.
> via the Environment tab in the System control panel, then you use %var%.
> If you're putting the variables in a zsh startup file, you use $var.
> 
> On Sep 14,  5:52pm, Amol Deshpande wrote:
> } Subject: RE: zsh for win32 - installation of zshrc
> }
> } Remember that these rules apply only if don't set HOME. Since there is
> } no /etc,  only the rules for locating files from $HOME are followed.
> 
> I don't have windows running at home, but yesterday I installed zsh.exe
> on an NT machine at work.  I created a d:\etc (d: being the boot drive on
> that machine) and put a zshenv file in it, and lo, zsh reads it.  So now
> the setting of TERM=vt100 and adding the gnu-win32 bin to the path and so
> on is in d:\etc\zshenv, and every user on that NT box gets it if they
> start zsh.  (I also put in HOME=$HOMEDRIVE$HOMEPATH; what was the reason
> for not defaulting $HOME from this on NT 4+ ?)
> 
> -- 
> Bart Schaefer                                 Brass Lantern Enterprises
> http://www.well.com/user/barts              http://www.brasslantern.com
> 


^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: zsh for win32 - installation of zshrc
@ 1998-09-15 18:00 Amol Deshpande
  1998-09-15 20:59 ` Bart Schaefer
  1998-09-15 21:40 ` Bart Schaefer
  0 siblings, 2 replies; 28+ messages in thread
From: Amol Deshpande @ 1998-09-15 18:00 UTC (permalink / raw)
  To: ZShell Users List, 'Bart Schaefer'; +Cc: amol



> ----------
> From: 	Bart Schaefer[SMTP:schaefer@brasslantern.com]
> Sent: 	Tuesday, September 15, 1998 10:18 AM
> To: 	ZShell Users List
> Cc: 	amol@blarg.net
> Subject: 	Re: zsh for win32 - installation of zshrc
> 
> 
> I don't have windows running at home, but yesterday I installed zsh.exe
> on an NT machine at work.  I created a d:\etc (d: being the boot drive on
> that machine) and put a zshenv file in it, and lo, zsh reads it.  So now
> the setting of TERM=vt100 and adding the gnu-win32 bin to the path and so
> on is in d:\etc\zshenv, and every user on that NT box gets it if they
> start zsh.  (I also put in HOME=$HOMEDRIVE$HOMEPATH; what was the reason
> for not defaulting $HOME from this on NT 4+ ?)
> 
each user is guaranteed to get a different $USERPROFILE, while I don't think
the $HOMEPATH changes unless you specifically set it for each user. not very
useful if you don't know in advance the usernames of everyone who may log
in.

-amol

> -- 
> Bart Schaefer                                 Brass Lantern Enterprises
> http://www.well.com/user/barts              http://www.brasslantern.com
> 


^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: zsh for win32 - installation of zshrc
@ 1998-09-11 18:27 Amol Deshpande
  0 siblings, 0 replies; 28+ messages in thread
From: Amol Deshpande @ 1998-09-11 18:27 UTC (permalink / raw)
  To: ZShell Users List, 'Sven Guckes'

you can either set ZDOTDIR or copy a .zshrc  to $USERPROFILE or $HOME

> ----------
> From: 	Sven Guckes[SMTP:guckes@math.fu-berlin.de]
> Sent: 	Friday, September 11, 1998 9:41 AM
> To: 	ZShell Users List
> Subject: 	zsh for win32 - installation of zshrc
> 
> Anyone using the win32 port of the zsh here?
> How do you install the zshrc on WindowsNT?
> I need to know the procedure as I had given
> the zsh.exe to someone who is eager to use it.
> 
> Sven  [still not using a WindowsNT machine]
> 


^ permalink raw reply	[flat|nested] 28+ messages in thread
* zsh for win32 - installation of zshrc
@ 1998-09-11 16:41 Sven Guckes
  1998-09-11 17:13 ` Stephen Rondeau
  1998-09-11 20:11 ` ric hotchkiss
  0 siblings, 2 replies; 28+ messages in thread
From: Sven Guckes @ 1998-09-11 16:41 UTC (permalink / raw)
  To: ZShell Users List

Anyone using the win32 port of the zsh here?
How do you install the zshrc on WindowsNT?
I need to know the procedure as I had given
the zsh.exe to someone who is eager to use it.

Sven  [still not using a WindowsNT machine]


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~1998-09-17 11:01 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <c=GB%a=_%p=Saudi_Internatio%l=SMS01-980911172557Z-1926@sms01.saudibank.com>
1998-09-12  5:43 ` zsh for win32 - installation of zshrc 'Sven Guckes'
1998-09-12  6:53   ` Bart Schaefer
1998-09-14 17:55     ` 'Sven Guckes'
1998-09-14 20:59       ` Amol Deshpande
1998-09-14 18:40         ` Amol Deshpande
1998-09-14 19:54           ` Bart Schaefer
1998-09-14 23:53           ` 'Sven Guckes'
1998-09-15  0:52             ` Amol Deshpande
1998-09-15  2:19               ` 'Sven Guckes'
1998-09-15  6:31                 ` Amol Deshpande
1998-09-15 12:52                   ` David N. Blank-Edelman
1998-09-15 17:08                     ` Stephen Marley
1998-09-16 12:20                       ` Hannu Koivisto
1998-09-16 13:26                         ` Stephen Marley
1998-09-17 10:48                           ` Hannu Koivisto
1998-09-16 15:32                         ` Bart Schaefer
1998-09-15 17:18                   ` Bart Schaefer
1998-09-16 23:08 Amol Deshpande
  -- strict thread matches above, loose matches on Subject: below --
1998-09-15 21:56 Amol Deshpande
1998-09-16  0:55 ` Bart Schaefer
1998-09-15 18:04 Amol Deshpande
1998-09-15 18:00 Amol Deshpande
1998-09-15 20:59 ` Bart Schaefer
1998-09-15 21:40 ` Bart Schaefer
1998-09-11 18:27 Amol Deshpande
1998-09-11 16:41 Sven Guckes
1998-09-11 17:13 ` Stephen Rondeau
1998-09-11 20:11 ` ric hotchkiss

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).