* zfinit problem in ksh emulation mode
@ 2010-07-28 11:36 Jerry Rocteur
2010-07-28 13:29 ` Peter Stephenson
0 siblings, 1 reply; 4+ messages in thread
From: Jerry Rocteur @ 2010-07-28 11:36 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
Hi,
I have a problem running zfinit in ksh emulation ( running zsh as a link
from /usr/bin/ksh )
When I try:
user@zambezi: autoload -U zfinit
user@zambezi: zfinit
zsh: zfinit: function not defined by file
However if I run zsh like this (which I'm not allowed to do in scripts)
user@zambezi: /bin/zsh
[user@zambezi]/usr/share/zsh% autoload -U zfinit
[user@zambezi]/usr/share/zsh% zfinit
[user@zambezi]/usr/share/zsh% zfparams puma jro PassW0rd
[user@zambezi]/usr/share/zsh% zfopen
[user@zambezi]/usr/share/zsh% zfls
.kshrc
.rhosts
.jrrc_hp
.ssh
It all works fine. So it is potentially possible.
Is there some option I can set in my script so that when my script runs as:
#!/usr/bin/ksh
That this will work ...
Thanks in advance,
Jerry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: zfinit problem in ksh emulation mode
2010-07-28 11:36 zfinit problem in ksh emulation mode Jerry Rocteur
@ 2010-07-28 13:29 ` Peter Stephenson
2010-07-28 13:43 ` Jerry Rocteur
0 siblings, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2010-07-28 13:29 UTC (permalink / raw)
To: zsh-users
On Wed, 28 Jul 2010 13:36:42 +0200
Jerry Rocteur <jerry.rocteur@gmail.com> wrote:
> I have a problem running zfinit in ksh emulation ( running zsh as a
> link from /usr/bin/ksh )
>
> When I try:
>
> user@zambezi: autoload -U zfinit
> user@zambezi: zfinit
> zsh: zfinit: function not defined by file
"autoload -Uz zfinit" is a better bet, to force zsh-style autoload.
Unfortunately we're not very consistent about using those flags in the
distributed functions, so while it'll probably run it might not do the
trick with the other zftp functions since zfinit currently runs just
"autoload -U ..." with the effects you've just seen. I'll apply a very
boring patch that fixes up every autoload under Functions in the
distribution, unless anybody knows of an exception (which would surprise
me).
Until then, you might want to modify zfinit by hand to replace all the
"autoload -U"s with "autoload -Uz". After that you might be OK, since I
was more successful with putting "emulate -L zsh" at the top of functions.
> Is there some option I can set in my script so that when my script
> runs as:
>
> #!/usr/bin/ksh
>
> That this will work ...
The obvious one to try is "unsetopt kshautoload".
--
Peter Stephenson <pws@csr.com> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: zfinit problem in ksh emulation mode
2010-07-28 13:29 ` Peter Stephenson
@ 2010-07-28 13:43 ` Jerry Rocteur
2010-07-28 15:19 ` Peter Stephenson
0 siblings, 1 reply; 4+ messages in thread
From: Jerry Rocteur @ 2010-07-28 13:43 UTC (permalink / raw)
To: Peter Stephenson; +Cc: zsh-users
[-- Attachment #1: Type: text/plain, Size: 2031 bytes --]
On Wed, Jul 28, 2010 at 15:29, Peter Stephenson <Peter.Stephenson@csr.com>wrote:
> On Wed, 28 Jul 2010 13:36:42 +0200
> Jerry Rocteur <jerry.rocteur@gmail.com> wrote:
> > I have a problem running zfinit in ksh emulation ( running zsh as a
> > link from /usr/bin/ksh )
> >
> > When I try:
> >
> > user@zambezi: autoload -U zfinit
> > user@zambezi: zfinit
> > zsh: zfinit: function not defined by file
>
> "autoload -Uz zfinit" is a better bet, to force zsh-style autoload.
>
> Unfortunately we're not very consistent about using those flags in the
> distributed functions, so while it'll probably run it might not do the
> trick with the other zftp functions since zfinit currently runs just
> "autoload -U ..." with the effects you've just seen. I'll apply a very
> boring patch that fixes up every autoload under Functions in the
> distribution, unless anybody knows of an exception (which would surprise
> me).
>
> Until then, you might want to modify zfinit by hand to replace all the
> "autoload -U"s with "autoload -Uz". After that you might be OK, since I
> was more successful with putting "emulate -L zsh" at the top of functions.
>
Thanks Peter, I can't change all the installation, I did try the -Uz zfinit
but then it failed with zfparams: function not defined.
I may be out of luck until they install an updated copy here!
> Is there some option I can set in my script so that when my script
> > runs as:
> >
> > #!/usr/bin/ksh
> >
> > That this will work ...
>
> The obvious one to try is "unsetopt kshautoload".
>
> I tried it but then when running zfinit I get:
zfinit:42: command not found: compctl
zfinit:50: command not found: compctl
zfinit:51: command not found: compctl
zfinit:52: command not found: compctl
zfinit:53: command not found: compctl
zfinit:58: command not found: compctl
zfinit:67: command not found: compctl
I can still write the scripts to run on my system but will have to wait for
a new version of zsh here before I can write production scripts
Thanks for the answer!
Cheers,
Jerry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: zfinit problem in ksh emulation mode
2010-07-28 13:43 ` Jerry Rocteur
@ 2010-07-28 15:19 ` Peter Stephenson
0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2010-07-28 15:19 UTC (permalink / raw)
To: zsh-users
On Wed, 28 Jul 2010 15:43:20 +0200
Jerry Rocteur <jerry.rocteur@gmail.com> wrote:
> Thanks Peter, I can't change all the installation, I did try the -Uz
> zfinit but then it failed with zfparams: function not defined.
You can copy zfinit somewhere earlier in your FPATH, which you might
need to set explicitly in your script (fpath doesn't work in ksh mode).
> > The obvious one to try is "unsetopt kshautoload".
> >
> > I tried it but then when running zfinit I get:
>
> zfinit:42: command not found: compctl
> zfinit:50: command not found: compctl
> zfinit:51: command not found: compctl
> zfinit:52: command not found: compctl
> zfinit:53: command not found: compctl
> zfinit:58: command not found: compctl
> zfinit:67: command not found: compctl
You don't need compctl. I think the problem is simply that it's not
autoloaded (as a builtin from a library) in ksh mode. This a rather
different issue and compctl is thouroughly out of date anyway; I probably
need to check if compctl is present. This should be harmless, in fact.
Index: Functions/Zftp/zfinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zftp/zfinit,v
retrieving revision 1.3
diff -p -u -r1.3 zfinit
--- Functions/Zftp/zfinit 28 Jul 2010 13:33:59 -0000 1.3
+++ Functions/Zftp/zfinit 28 Jul 2010 15:18:28 -0000
@@ -34,7 +34,8 @@ autoload -Uz zfstat zftp_chpwd zftp_prog
# zftp completions: only use these if new-style completion is not
# active.
#
-if [[ ${#_patcomps} -eq 0 || -z ${_patcomps[(r)_zf*]} ]]; then
+if [[ ${#_patcomps} -eq 0 || -z ${_patcomps[(r)_zf*]} ]] &&
+ (compctl >/dev/null 2>&1); then
# only way of getting that noglob out of the way: this is unnecessary with
# widget-based completion
setopt completealiases
--
Peter Stephenson <pws@csr.com> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-28 15:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28 11:36 zfinit problem in ksh emulation mode Jerry Rocteur
2010-07-28 13:29 ` Peter Stephenson
2010-07-28 13:43 ` Jerry Rocteur
2010-07-28 15:19 ` Peter Stephenson
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).