Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems installing zopen #3

Open
mgrossmann opened this issue Sep 5, 2023 · 15 comments
Open

Problems installing zopen #3

mgrossmann opened this issue Sep 5, 2023 · 15 comments
Assignees

Comments

@mgrossmann
Copy link

mgrossmann commented Sep 5, 2023

Hello,

I tried to install version 0.6.0.
My environment could not be named as of end of this month.
So I'm not running bash but another nice shell.

According to the documentation I started running

. ./.env
./.env:1: parse error near `)'

So I fixed this issue by manually setting the path as in the .env script.

After installation I tried to source the new environment via:

. /u/ZOPEN/etc/.zopen-config

deleteDuplicateEntries:4: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: sed
sanitizeEnvVar:8: FSUZ0085 command not found: awk
...
 Processing z/OS Open Tools configuration: % (/)
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
...
- Processing z/OS Open Tools configuration: % (/)
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
...
- Processing z/OS Open Tools configuration: % (/)
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
...
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
- Processed z/OS Open Tools configuration: 100% (/)

It looks like the shell function sanitizeEnvVar() {} failed and afterwards $PATH is missing
the new PATH variable.

Thx, Mike

@IgorTodorovskiIBM IgorTodorovskiIBM self-assigned this Sep 5, 2023
@IgorTodorovskiIBM
Copy link
Collaborator

. ./.env
./.env:1: parse error near `)'

This is strange, when you ran the above command was .env in the current working directory? What shell are you using?

For the missing commands, I don't see why it shouldn't work, unless your shell is evaluating PATH before calling sanitizeEnvvar()?

# Environment variables
PATH=\$ZOPEN_ROOTFS/usr/bin:\$ZOPEN_ROOTFS/bin:\$ZOPEN_ROOTFS/boot:\$(sanitizeEnvVar \"\$PATH\" \":\" \"^\$ZOPEN_PKGINSTALL/.*\$\")

Are you able to add a set -x to zopen-config and provide the output?

@mgrossmann
Copy link
Author

mgrossmann commented Sep 5, 2023

Hello @IgorTodorovskiIBM

First things first. Using /bin/sh lets me install everything just fine.
In my case, I'm using the ZSH. But BASH will behave in the same way, I'm pretty sure.
I will test it tomorrow. In the meantime, I found the problem with .zopen-config.

The ZSH built-in function echo seems to dishonor the _BPXK_AUTOCVT setting.
Issuing an echo "Hello" | more will output garbage. Using /bin/echo | more is working
just fine. So the sanitizeEnvvar() produces an unpredictable output and the original $PATH
got lost in the newly built PATH variable.

Regarding the sourcing of the .env file, I actually have no idea. It looks like the ZSH dies before
just executing/sourcing the file. I already have added set -x and some echo statements.
The shell is always complaining about an error near ')' in line 1.

More on this, tomorrow.

Best,
Mike

@MikeFultonDev
Copy link
Collaborator

The 'nice shell' is an early drop of zsh ?

@MikeFultonDev
Copy link
Collaborator

echo is known to not be super-portable - @IgorTodorovskiIBM perhaps that is an issue... If this is zsh, we will be able to test easier after GA of z/OS 3.1

@IgorTodorovskiIBM
Copy link
Collaborator

In zsh, echo is a builtin, I wonder if the pipes are not properly tagged, because more is a ebcdic application.

@mgrossmann
Copy link
Author

I'm not sure I'm allowed but I can do tests until GA of z/OS 3.1. Just a few weeks. :)

| The 'nice shell' is an early drop of zsh ?
y e s

@mgrossmann
Copy link
Author

@IgorTodorovskiIBM

more was just an example. I also tested it as echo "Hell" | echo or even with tee. So yes, I think the pipe produces the problem, when using the built-in.

@IgorTodorovskiIBM
Copy link
Collaborator

This is what I get with zsh:

./.env:1: FSUZ0202 unmatched '

The builtins seemed to be working though for me.

@mgrossmann
Copy link
Author

@IgorTodorovskiIBM

You just tested .env or .zopen-config as well?
I'm home in 20 minutes. Then I can connect to the host.

So if I could do / test anything, let me know.

@IgorTodorovskiIBM
Copy link
Collaborator

@IgorTodorovskiIBM

You just tested .env or .zopen-config as well? I'm home in 20 minutes. Then I can connect to the host.

So if I could do / test anything, let me know.

I can't get past the .env issue, even by setting the PATH to its directory. I wonder if we have different versions installed.

PLPSC% zsh --version
zsh 5.8.1 (i370-ibm-openedition)

@mgrossmann
Copy link
Author

I'm currently on an older version.

MIKEG1@S0W1: ~ $ zsh --version
zsh 5.8.0.2-dev (i370-ibm-openedition)

But we will upgrade our system in the next days.

So in the end there are two problems, right?
Both are related to not using /bin/sh as shell.

First is sourcing the .env file, second is sourcing the .zopen-config file.

The second one, is related to a pipe or echo built-in problem.

Could you please confirm the echo / pipe problem?

MIKEG1@S0W1: ~ $ echo "Hallo" 2>&1 | tee test
�/%%?#                                                                                                                                                              
MIKEG1@S0W1: ~ $ cat test
�/%%?#                                 

vs.

MIKEG1@S0W1: ~ $ /bin/echo "Hallo" 2>&1 | tee test
Hallo
MIKEG1@S0W1: ~ $ cat test
Hallo

/MIKE

@mgrossmann
Copy link
Author

@IgorTodorovskiIBM
You just tested .env or .zopen-config as well? I'm home in 20 minutes. Then I can connect to the host.
So if I could do / test anything, let me know.

I can't get past the .env issue, even by setting the PATH to its directory. I wonder if we have different versions installed.

PLPSC% zsh --version
zsh 5.8.1 (i370-ibm-openedition)

I din't get .env working, either. I set up the path in the manual way, without using the .env file.

@IgorTodorovskiIBM
Copy link
Collaborator

The pipe issue seems to be resolved:

PLPSC% echo "Hallo" 2>&1 | tee testigor
Hallo
PLPSC% cat testigor
Hallo
PLPSC%

@SunnyChenBJ
Copy link

@IgorTodorovskiIBM , the current zsh is v5.8.1, in which the pipe issue was fixed. The output on AQ is as below:

6:50:30 ~ $echo "Hallo" 2>&1 | tee testme
Hallo
6:50:37 ~ $cat testme
Hallo

Sunny

@MikeFultonDev
Copy link
Collaborator

Can we close @mgrossmann ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants