From: "Daniel Richard G." <skunk@iSKUNK.ORG>
To: "Bruno Haible" <bruno@clisp.org>, bug-gnulib@gnu.org
Subject: Re: IBM z/OS compatibility issues - shell environment
Date: Mon, 18 Nov 2019 18:13:47 -0500 [thread overview]
Message-ID: <d32f8b40-cb71-4a4d-afa6-68668646c98a@www.fastmail.com> (raw)
In-Reply-To: <3750999.0oZWRMndTk@omega>
On Sun, 2019 Nov 17 22:24-05:00, Bruno Haible wrote:
> >
> > The problem, however, is that shell scripting with this version
> > of Bash can be a little tricky, because it doesn't fully
> > embrace EBCDIC. ... These are the settings I used which allow
> > things to work:
> >
> > _ENCODE_FILE_NEW=IBM-1047
> > _ENCODE_FILE_EXISTING=IBM-1047
> > _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
> > _BPXK_AUTOCVT=ON
> > _TAG_REDIR_ERR=txt
> > _TAG_REDIR_IN=txt
> > _TAG_REDIR_OUT=txt
>
> Can we have this documented in the column "Other variables" of
> https://gitlab.com/ghwiki/gnow-how/wikis/Platforms/Configuration ?
It's quite a bit of verbiage to stick into a table cell! Might a
separate page be appropriate? Scripts could give the URL to it in
lieu of a more descriptive error message if they detect breakage
related to this.
> > While I would not recommend giving to init.sh knowledge of the above
> > variables, I think it would be helpful to do some basic sanity
> > checking (like the echo|grep invocation above) to avoid more
> > pathological breakage later in the script. The failure message could
> > include a hint to the user about what's wrong with the shell, and
> > what needs to be done to fix it.
>
> The 'echo ABC | grep ABC > /dev/null' command is indeed something that
> we could check in a number of shell scripts. In which shell scripts do
> you wish it to be added?
When /bin/sh is used to build Gnulib, everything works great. The
top-level configure run and most other incidental shell scripts are
covered by this.
It's only when a shell script decides "/bin/sh is junk, I want bash"
that trouble arises. And when I do a standard "./configure && make &&
make check" run, this doesn't happen until it gets to test-atexit.sh.
What is notable about that one is that it appears to be the first
shell-script test that sources init.sh.
Here is what appears on the console when I attempt to run this test
manually, with the Rocket build of bash in my PATH:
$ env srcdir=/tmp/testdir/gltests /tmp/testdir/gltests/test-atexit.sh
expr: non-numeric argument "@@@@@??@"
/tmp/testdir/gltests/init.sh: line 366: test: ?: integer expression expecd
expr: non-numeric argument "?"
/tmp/testdir/gltests/init.sh: line 366: test: 4: unary operator expected
Usage: expr expression
/tmp/testdir/gltests/init.sh: line 366: test: 4: unary operator expected
Usage: expr expression
/tmp/testdir/gltests/init.sh: line 366: test: 4: unary operator expected
Usage: expr expression
/tmp/testdir/gltests/init.sh: line 366: test: 4: unary operator expected
Usage: expr expression
/tmp/testdir/gltests/init.sh: line 366: test: 4: unary operator expected
Usage: expr expression
[continues on forever]
The init.sh script starts off in /bin/sh but looks for and executes
bash, presumably to obtain more advanced shell functionality.
Even before trying to fix this, I'm wondering: Is this really necessary?
The place where it gets stuck above is in the mktempd_() shell function,
which provides the functionality of a missing mktemp(1). Given that this
is running in a build tree, wouldn't something like prefix$$ be enough?
If that can't be helped, then at least init.sh should perform this
sanity check. I see that there is already some shell-checking in place
via gl_shell_test_script_; perhaps this could be an added check. I hope
a helpful error message can be part of it too.
--Daniel
--
Daniel Richard G. || skunk@iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.
next prev parent reply other threads:[~2019-11-18 23:15 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 18:03 IBM z/OS compatibility issues Daniel Richard G.
2019-11-05 22:23 ` Paul Eggert
2019-11-06 14:57 ` Daniel Richard G.
2019-11-06 19:32 ` Paul Eggert
2019-11-08 21:22 ` Daniel Richard G.
2019-11-17 23:21 ` Bruno Haible
2019-11-18 19:30 ` Daniel Richard G.
2019-12-13 12:58 ` Bruno Haible
2019-12-14 1:51 ` Daniel Richard G.
2019-12-14 13:51 ` Bruno Haible
2020-01-09 5:46 ` Daniel Richard G.
2019-11-18 0:17 ` IBM z/OS compatibility issues - per-thread locale functions Bruno Haible
2019-11-18 5:36 ` Daniel Richard G.
2019-11-18 11:41 ` Bruno Haible
2019-11-18 18:49 ` Daniel Richard G.
2019-12-12 12:56 ` Bruno Haible
2019-12-12 19:35 ` Daniel Richard G.
2019-12-13 10:32 ` Bruno Haible
2019-12-13 20:33 ` Daniel Richard G.
2019-12-14 13:36 ` Bruno Haible
2019-12-19 23:46 ` Daniel Richard G.
2019-12-20 6:43 ` Bruno Haible
2019-11-18 3:18 ` IBM z/OS compatibility issues - pthread Bruno Haible
2019-11-18 21:06 ` Daniel Richard G.
2019-12-13 12:43 ` Bruno Haible
2019-12-13 21:10 ` Daniel Richard G.
2019-12-14 13:42 ` Bruno Haible
2019-12-20 0:10 ` Daniel Richard G.
2019-12-21 5:30 ` Bruno Haible
2019-11-18 3:24 ` IBM z/OS compatibility issues - shell environment Bruno Haible
2019-11-18 23:13 ` Daniel Richard G. [this message]
2019-11-18 3:34 ` IBM z/OS compatibility issues - environment variables Bruno Haible
2019-11-19 3:20 ` Daniel Richard G.
2019-11-18 3:41 ` IBM z/OS compatibility issues - miscellaneous bugs Bruno Haible
2019-11-19 3:39 ` Daniel Richard G.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d32f8b40-cb71-4a4d-afa6-68668646c98a@www.fastmail.com \
--to=skunk@iskunk.org \
--cc=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).