ifthenelse bugged?

From: Olivier Brunel <jjk_at_jjacky.com>
Date: Sat, 31 Jan 2015 19:35:36 +0100

Hi,

So I may be doing/understanding something wrong, but it seems to me that
ifthenelse isn't exactly working as expected:

% execlineb -c 'ifthenelse { exit } { echo ok } { echo fail } echo next'
ok
ok
next
next

According to the doc, it should be the same as the following:

% execlineb -c 'foreground { ifte { echo ok } { echo fail } exit } echo
next'
ok
next

Obviously it isn't, as only the later works as expected (or, as I do
expect). A quick look at the code for ifthenelse has me wondering why
there's a fork() at line 44:

  argv[argc1] = 0 ;
  pid = fork() ;
  pid = el_spawn0(argv[0], argv, envp) ;
  if (!pid) strerr_diefu2sys(111, "spawn ", argv[0]) ;

Is that really normal? And if so, where's my error using ifthenelse?

Cheers,
-j
Received on Sat Jan 31 2015 - 18:35:36 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC