zsh-workers
 help / color / mirror / code / Atom feed
* Strange problem with ulimit
@ 2003-11-08  9:50 David Gómez
  2003-11-09 16:18 ` DervishD
  0 siblings, 1 reply; 8+ messages in thread
From: David Gómez @ 2003-11-08  9:50 UTC (permalink / raw)
  To: Zsh-workers

Hi all ;),

I noticed that if a script has a bang path with /bin/sh (which in my case
points to zsh) the ulimit built-in is not found. Is deliberate to not
use some built-ins when zsh in in bash-compatible mode?

Thanks

-- 
David Gómez

"The question of whether computers can think is just like the question of
 whether submarines can swim." -- Edsger W. Dijkstra


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

* Re: Strange problem with ulimit
  2003-11-08  9:50 Strange problem with ulimit David Gómez
@ 2003-11-09 16:18 ` DervishD
  2003-11-09 21:21   ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: DervishD @ 2003-11-09 16:18 UTC (permalink / raw)
  To: Zsh-workers

    Hi David :)

 * Davilín <david@pleyades.net> dixit:
> I noticed that if a script has a bang path with /bin/sh (which in
> my case points to zsh) the ulimit built-in is not found. Is
> deliberate to not use some built-ins when zsh in in bash-compatible
> mode?

    I can reproduce it here, with zsh 4.0.7. I've took a look at the
sources, with no success :((

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


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

* Re: Strange problem with ulimit
  2003-11-09 16:18 ` DervishD
@ 2003-11-09 21:21   ` Bart Schaefer
  2003-11-10 10:24     ` David Gómez
  2003-11-10 10:57     ` DervishD
  0 siblings, 2 replies; 8+ messages in thread
From: Bart Schaefer @ 2003-11-09 21:21 UTC (permalink / raw)
  To: Zsh-workers

[Hmm, I don't seem to have received the first message in this thread.]

On Nov 9,  5:18pm, DervishD wrote:
}
}  * Davilín <david@pleyades.net> dixit:
} > I noticed that if a script has a bang path with /bin/sh (which in
} > my case points to zsh) the ulimit built-in is not found. Is
} > deliberate to not use some built-ins when zsh in in bash-compatible
} > mode?
} 
}     I can reproduce it here, with zsh 4.0.7. I've took a look at the
} sources, with no success :((

That's because the code in question is in the file "bltinmods.list"
which is generated at configure time and then #include'd by init.c.

The "ulimit" builtin is not a full-fledged builtin -- it's supplied by
the zsh/rlimits module.  Even though that module is normally linked to
the base executable (rather than dynamically loaded), the rule is that
modules have to pass through zmodload before any of their functionality
is available.

Modules are zmodload'd automatically at startup only when the shell is
invoked as zsh.  This is to prevent clashes with command and variable
names used e.g. by "sh" scripts that are expecting a clean namespace.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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

* Re: Strange problem with ulimit
  2003-11-09 21:21   ` Bart Schaefer
@ 2003-11-10 10:24     ` David Gómez
  2003-11-10 16:42       ` Bart Schaefer
  2003-11-10 10:57     ` DervishD
  1 sibling, 1 reply; 8+ messages in thread
From: David Gómez @ 2003-11-10 10:24 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh-workers

Hi Bart ;),

On Nov 09 at 09:21:36, Bart Schaefer wrote:
> [Hmm, I don't seem to have received the first message in this thread.]

I won't be surprised that some messages are lost at the mail servers.
These last days i'm being hitted (again) by the infamous "Microsoft
support" virus, and i guess several mail servers are being bombed too...

> The "ulimit" builtin is not a full-fledged builtin -- it's supplied by
> the zsh/rlimits module. 

Aha, i didn't know that it was supplied by the rlimits module...

> Even though that module is normally linked to
> the base executable (rather than dynamically loaded),

Are there more builtins with this behavior?

> Modules are zmodload'd automatically at startup only when the shell is
> invoked as zsh.  This is to prevent clashes with command and variable
> names used e.g. by "sh" scripts that are expecting a clean namespace.

Ok, thanks for the info. I justed wanted to know if it was a expected
behavior or some kind of bug.

Cheers,

-- 
David Gómez

"The question of whether computers can think is just like the question of
 whether submarines can swim." -- Edsger W. Dijkstra


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

* Re: Strange problem with ulimit
  2003-11-09 21:21   ` Bart Schaefer
  2003-11-10 10:24     ` David Gómez
@ 2003-11-10 10:57     ` DervishD
  2003-11-10 16:42       ` Bart Schaefer
  1 sibling, 1 reply; 8+ messages in thread
From: DervishD @ 2003-11-10 10:57 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh-workers

    Hi Bart :)

 * Bart Schaefer <schaefer@brasslantern.com> dixit:
> [Hmm, I don't seem to have received the first message in this thread.]

    That's a problem that I have had frequently with this list.
Sometimes I don't receive posts :(( Lately that seemed to be solved
(for me, at least)...
 
> }     I can reproduce it here, with zsh 4.0.7. I've took a look at the
> } sources, with no success :((
> That's because the code in question is in the file "bltinmods.list"
> which is generated at configure time and then #include'd by init.c.

    OK ;))
 
> The "ulimit" builtin is not a full-fledged builtin -- it's supplied by
> the zsh/rlimits module.

    I knew that. What I didn't know was that modules weren't loaded
when zsh was invoked as sh. Which, on the other hand, makes sense...

> Modules are zmodload'd automatically at startup only when the shell is
> invoked as zsh.  This is to prevent clashes with command and variable
> names used e.g. by "sh" scripts that are expecting a clean namespace.

    Does that mean that you can zmodload zsh/rlimits and have again
the builtin?

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


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

* Re: Strange problem with ulimit
  2003-11-10 10:24     ` David Gómez
@ 2003-11-10 16:42       ` Bart Schaefer
  2003-11-10 19:23         ` David Gómez
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2003-11-10 16:42 UTC (permalink / raw)
  To: Zsh-workers

On Nov 10, 11:24am, David wrote:
}
} On Nov 09 at 09:21:36, Bart Schaefer wrote:
} > [Hmm, I don't seem to have received the first message in this thread.]
} 
} I won't be surprised that some messages are lost at the mail servers.

Actually it appears that my mail client had a killfile-type filter on
the iso-8859-15 character set, which I must have installed _years_ ago
(as in, pre-1996) and forgotten about.

} > Even though that module is normally linked to
} > the base executable (rather than dynamically loaded),
} 
} Are there more builtins with this behavior?

There are lots of builtins that are supplied by modules,but zsh/rlimits
appears to be the only module documented as if it's always builtin.  So,
"limit" and "unlimit"  are also affected.

Incidentally, in reference to the original article on this thread, zsh
does not have a bash emulation mode.  It emulates plain "sh" (as in,
the original Bourne shell from before the GNU project even existed),
ksh, and (approximately) csh.  It happens to treat "emulate bash" as
"emulate sh" but that doesn't get you all that far.


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

* Re: Strange problem with ulimit
  2003-11-10 10:57     ` DervishD
@ 2003-11-10 16:42       ` Bart Schaefer
  0 siblings, 0 replies; 8+ messages in thread
From: Bart Schaefer @ 2003-11-10 16:42 UTC (permalink / raw)
  To: Zsh-workers

On Nov 10, 11:57am, DervishD wrote:
} 
} > Modules are zmodload'd automatically at startup only when the shell is
} > invoked as zsh.
} 
}     Does that mean that you can zmodload zsh/rlimits and have again
} the builtin?

That's correct.  The zmodload builtin itself is always available (unless
"disable"d).


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

* Re: Strange problem with ulimit
  2003-11-10 16:42       ` Bart Schaefer
@ 2003-11-10 19:23         ` David Gómez
  0 siblings, 0 replies; 8+ messages in thread
From: David Gómez @ 2003-11-10 19:23 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh-workers

Hi Bart ;),

> Actually it appears that my mail client had a killfile-type filter on
> the iso-8859-15 character set, which I must have installed _years_ ago
> (as in, pre-1996) and forgotten about.

That seems to explain it, then ;)

> There are lots of builtins that are supplied by modules,but zsh/rlimits
> appears to be the only module documented as if it's always builtin.  So,
> "limit" and "unlimit"  are also affected.

It seems logical anyway that is not executed automatically, as sh-like shells
don't bring inside a ulimit built-in.

> ksh, and (approximately) csh.  It happens to treat "emulate bash" as
> "emulate sh" but that doesn't get you all that far.

Yeah, i know it only emulates Bourne shell ;), i'd should clarified that.
Indeed i wanted to say "running zsh in sh emulation mode where most of
my old bash scripts work" ;)))

Thanks for your help,

-- 
David Gómez

"The question of whether computers can think is just like the question of
 whether submarines can swim." -- Edsger W. Dijkstra


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

end of thread, other threads:[~2003-11-10 19:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-08  9:50 Strange problem with ulimit David Gómez
2003-11-09 16:18 ` DervishD
2003-11-09 21:21   ` Bart Schaefer
2003-11-10 10:24     ` David Gómez
2003-11-10 16:42       ` Bart Schaefer
2003-11-10 19:23         ` David Gómez
2003-11-10 10:57     ` DervishD
2003-11-10 16:42       ` Bart Schaefer

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