zsh-users
 help / color / mirror / code / Atom feed
* Lua / zsh problems
@ 2012-06-19 18:27 meino.cramer
  2012-06-19 19:03 ` Frank Terbeck
  2012-06-19 19:05 ` Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: meino.cramer @ 2012-06-19 18:27 UTC (permalink / raw)
  To: zsh-users

Hi,

the Lua programming language uses a module/extensions manager called
"luarocks", which installs extensions like cpan does for perl.
These extensions are called "rocks".

To instruct lua, where to search for the extensions, one has
to define the environment variable called "LUA_PATH", which 
could for example look like this:

LUA_PATH='/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua

The "?" are no type but are placeholders for the name of
the extension to load.

But...

zsh tries to play its magic with these "?"s. 

    echo $LUA_PATH 

gives:

zsh: no matches found: LUA_PATH='/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua'

and lua does not find any extensions at all.

I tried a lot backslashing, quoting and such to as
prevent zsh from do something special with those "?"s 
as pass the pure "?" to lua...and no "\?" which in turn
Lua does not understand...
But with no success...

How can I fix this problem?

Thank you very much in advance for
any help!
Best regards,
mcc




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

* Re: Lua / zsh problems
  2012-06-19 18:27 Lua / zsh problems meino.cramer
@ 2012-06-19 19:03 ` Frank Terbeck
  2012-06-19 19:05 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Terbeck @ 2012-06-19 19:03 UTC (permalink / raw)
  To: meino.cramer; +Cc: zsh-users

meino.cramer@gmx.de wrote:
[...]
>     echo $LUA_PATH 
>
> gives:
>
> zsh: no matches found:
> LUA_PATH='/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua'

You're probably setting the "prompt_subst" option, which is not the
default.

If you set it you need to double quote all parameters to avoid file name
expansion. So you would do this:

  echo "$LUA_PATH"

But really, why set that option? IMHO zsh fixes one of the biggest
faults of POSIX shells by not expanding globs and by not IFS-splitting
non-quoted string variables... unless you ask for it explicitly.

If you like the POSIX like behaviour better you need to abide by its
most important idiom too: Double-quote *EVERY* parameter you use, unless
you *know* you want the non-quoted behaviour.

> and lua does not find any extensions at all.

I don't know why that is, though.

<guess>The semicolons are correct as delimiters?</guess>


Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


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

* Re: Lua / zsh problems
  2012-06-19 18:27 Lua / zsh problems meino.cramer
  2012-06-19 19:03 ` Frank Terbeck
@ 2012-06-19 19:05 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2012-06-19 19:05 UTC (permalink / raw)
  To: zsh-users

meino.cramer@gmx.de wrote:
>     echo $LUA_PATH 
> 
> gives:
> 
> zsh: no matches found: LUA_PATH='/usr/lib64/lua/luarocks/share/lua/5.1//?.lua
> ;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;
> /usr/share/lua/5.1//?/init.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/
> usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/u
> sr/share/lua/5.1//?/init.lua;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/loca
> l/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.
> 1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua'

Something's gone screwy in setting the path.  What you're echoing back
is the exact command that should have set it, not what should be the
contents of the variable.  I'd expect to see the error message

zsh: no matches found: /usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?.lua;/usr/lib64/lua/luarocks/share/lua/5.1//?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua

if the variable LUA_PATH contains that value and the shell is attempting
to use it as a glob pattern.  You need to fix that before you'll get
a sane value.

Unless you have the globsubst option set, ?'s from a variable aren't
expanded.  If you do have globsubst set, which behaves like other
shells, you should probably set the option nonomatch, too, which doesn't
complain if the expansion fails.  Usually in zsh there's no reason to
set globsubst at all, however.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


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

end of thread, other threads:[~2012-06-19 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19 18:27 Lua / zsh problems meino.cramer
2012-06-19 19:03 ` Frank Terbeck
2012-06-19 19:05 ` 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).