Oh, ok. I have executed the examples for you now.

What I expected was also in the first mail:

1) The one.make.sh.log has the expected output. The same commands executed
from a Makefile (one.make.log) do not behave as expected. This also holds
for this command executed from the command line.
2) The two.make.log has the expected. The same commands executed from the
bash script do not behave as expected. I'm having trouble obtaining the
desired results with the bash script.

Regards,
Mischa Baars.

On Mon, Mar 11, 2024 at 6:27 PM Paul Smith <psm...@gnu.org> wrote:

> On Mon, 2024-03-11 at 18:14 +0100, Mischa Baars wrote:
> > The actual command invocations (a Makefile, a make.sh script) can be
> > found in the attachment, as indicated on the first line of the mail.
> > In the attachment there are two directories, one and two, belonging
> > to 1) and 2) respectively.
>
> That's not what I asked: I asked YOU to run the commands on YOUR system
> and cut and paste the results of the run into your email message, with
> an explicit explanation of exactly what is wrong with the results and
> what you wanted to see instead.  What errors did you get?  Or what was
> unexpected about the behavior?
>
> I'm not interested in running random scripts on my system that were
> downloaded from an email, or examining their behavior to make sure
> they're OK, or setting up a container to run them in, or guessing what
> you wanted to happen, etc.
>

A container? These are no viri, these are scripts :)


> Or maybe someone else will want to do that work instead.
>
> But before putting in more effort on the "misbehaving" makefile, read
> this part of my response carefully:
>
> > But before you do that, be aware that make does NOT invoke /bin/bash
> > as its shell.  It invokes /bin/sh.  On some systems /bin/sh is
> > actually an alias for bash.  On other systems it isn't.
> >
> > If you want your makefile to always use bash as its shell, you should
> > add an explicit:
> >
> >     SHELL := /bin/bash
> >
> > to your makefile to force it.  Maybe that will solve your problem.
> > If not we'll need details such as I mention above.
>
> and verify in your response you added the suggested line to your
> makefile and it didn't help (in the situation where the makefile was
> behaving in an unexpected way).
>

No. Doesn't help the tiniest bit.
SECONDS=5; for (( i=0;i<32;i++ )); do { exit ${i}; } & pid[${i}]=${!}; done; sleep ${SECONDS}; for (( i=0;i<32;i++ )); do wait -n ${pid[${i}]}; e=${?}; echo "$(printf %3u ${i}) pid ${pid[${i}]} exit ${e}"; done;
/bin/bash: line 1: wait: 1747087: no such job
  0 pid 1747087 exit 127
/bin/bash: line 1: wait: 1747088: no such job
  1 pid 1747088 exit 127
/bin/bash: line 1: wait: 1747089: no such job
  2 pid 1747089 exit 127
/bin/bash: line 1: wait: 1747090: no such job
  3 pid 1747090 exit 127
/bin/bash: line 1: wait: 1747091: no such job
  4 pid 1747091 exit 127
/bin/bash: line 1: wait: 1747092: no such job
  5 pid 1747092 exit 127
/bin/bash: line 1: wait: 1747093: no such job
  6 pid 1747093 exit 127
/bin/bash: line 1: wait: 1747094: no such job
  7 pid 1747094 exit 127
/bin/bash: line 1: wait: 1747095: no such job
  8 pid 1747095 exit 127
/bin/bash: line 1: wait: 1747096: no such job
  9 pid 1747096 exit 127
/bin/bash: line 1: wait: 1747097: no such job
 10 pid 1747097 exit 127
/bin/bash: line 1: wait: 1747098: no such job
 11 pid 1747098 exit 127
/bin/bash: line 1: wait: 1747099: no such job
 12 pid 1747099 exit 127
/bin/bash: line 1: wait: 1747100: no such job
 13 pid 1747100 exit 127
/bin/bash: line 1: wait: 1747101: no such job
 14 pid 1747101 exit 127
/bin/bash: line 1: wait: 1747102: no such job
 15 pid 1747102 exit 127
/bin/bash: line 1: wait: 1747103: no such job
 16 pid 1747103 exit 127
/bin/bash: line 1: wait: 1747104: no such job
 17 pid 1747104 exit 127
/bin/bash: line 1: wait: 1747105: no such job
 18 pid 1747105 exit 127
/bin/bash: line 1: wait: 1747106: no such job
 19 pid 1747106 exit 127
/bin/bash: line 1: wait: 1747107: no such job
 20 pid 1747107 exit 127
/bin/bash: line 1: wait: 1747108: no such job
 21 pid 1747108 exit 127
/bin/bash: line 1: wait: 1747109: no such job
 22 pid 1747109 exit 127
/bin/bash: line 1: wait: 1747110: no such job
 23 pid 1747110 exit 127
/bin/bash: line 1: wait: 1747111: no such job
 24 pid 1747111 exit 127
/bin/bash: line 1: wait: 1747112: no such job
 25 pid 1747112 exit 127
/bin/bash: line 1: wait: 1747113: no such job
 26 pid 1747113 exit 127
/bin/bash: line 1: wait: 1747114: no such job
 27 pid 1747114 exit 127
/bin/bash: line 1: wait: 1747115: no such job
 28 pid 1747115 exit 127
/bin/bash: line 1: wait: 1747116: no such job
 29 pid 1747116 exit 127
/bin/bash: line 1: wait: 1747117: no such job
 30 pid 1747117 exit 127
/bin/bash: line 1: wait: 1747118: no such job
 31 pid 1747118 exit 127
  0 pid 1746688 exit 0
  1 pid 1746689 exit 1
  2 pid 1746690 exit 2
  3 pid 1746691 exit 3
  4 pid 1746692 exit 4
  5 pid 1746693 exit 5
  6 pid 1746694 exit 6
  7 pid 1746695 exit 7
  8 pid 1746696 exit 8
  9 pid 1746697 exit 9
 10 pid 1746698 exit 10
 11 pid 1746699 exit 11
 12 pid 1746700 exit 12
 13 pid 1746701 exit 13
 14 pid 1746702 exit 14
 15 pid 1746703 exit 15
 16 pid 1746704 exit 16
 17 pid 1746705 exit 17
 18 pid 1746706 exit 18
 19 pid 1746707 exit 19
 20 pid 1746708 exit 20
 21 pid 1746709 exit 21
 22 pid 1746710 exit 22
 23 pid 1746711 exit 23
 24 pid 1746712 exit 24
 25 pid 1746713 exit 25
 26 pid 1746714 exit 26
 27 pid 1746715 exit 27
 28 pid 1746716 exit 28
 29 pid 1746717 exit 29
 30 pid 1746718 exit 30
 31 pid 1746719 exit 31
STRINGIZED: 0, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 1, STRING: one and two
<command-line>: warning: missing terminating " character
/usr/bin/ld: cannot find and: No such file or directory
/usr/bin/ld: cannot find two": No such file or directory
collect2: error: ld returned 1 exit status
./make.sh: line 31: ./main: No such file or directory
<command-line>: warning: missing terminating " character
/usr/bin/ld: cannot find and: No such file or directory
/usr/bin/ld: cannot find two": No such file or directory
collect2: error: ld returned 1 exit status
./make.sh: line 32: ./main: No such file or directory
<command-line>: warning: missing terminating " character
/usr/bin/ld: cannot find and: No such file or directory
/usr/bin/ld: cannot find two": No such file or directory
collect2: error: ld returned 1 exit status
./make.sh: line 33: ./main: No such file or directory
<command-line>: warning: missing terminating " character
/usr/bin/ld: cannot find and: No such file or directory
/usr/bin/ld: cannot find two": No such file or directory
collect2: error: ld returned 1 exit status
./make.sh: line 34: ./main: No such file or directory
STRINGIZED: 0, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 0, STRING: one and two
STRINGIZED: 1, STRING: one and two
STRINGIZED: 1, STRING: one and two

Reply via email to