ZOSOpenTools / meta

Meta repository to tie together the various underlying z/OS Open Source tools repositories here
https://zosopentools.github.io/meta/
Apache License 2.0
37 stars 25 forks source link

Sourcing zopen-config in a script that takes in arguments results in Error. Unknown parameter 'x' passed to zopen-config. #785

Closed IgorTodorovskiIBM closed 2 weeks ago

IgorTodorovskiIBM commented 3 weeks ago

Related metaport issue: https://github.com/ZOSOpenTools/metaport/issues/56

If we have a script that accepts multiple arguments, the arguments get passed down to zopen-config.

run.sh:

#!/bin/env sh
. /home/itodoro/zopen/etc/zopen-config
 ./run.sh bla
Error. Unknown parameter 'bla' passed to zopen-config.

Adding set -- before the . /home/itodoro/zopen/etc/zopen-config resolved it. We could document this. Alternatively, we could avoid printing an error in zopen-config.

Not sure if there are better ways. For now, I'll add set -- in https://github.com/ZOSOpenTools/metaport/blob/main/tests/zopen_check_basic_install#L32-L34

IgorTodorovskiIBM commented 2 weeks ago

Resolved now