IBM / db2-samples

Db2 application code, configuration samples, and other examples
https://www.ibm.com/analytics/developing-with-db2
Apache License 2.0
85 stars 86 forks source link

db2mon script throwing error in Ubuntu 20.4 intermiddently #75

Open sonalkakode1 opened 12 months ago

sonalkakode1 commented 12 months ago

/home/db2inst1/sqllib/samples/perf/db2mon.sh: 49: [: 60: unexpected operator

https://github.com/IBM/db2-samples/blob/master/perf/db2mon.sh

kdrodger commented 12 months ago

Good catch. I am surprised you're saying this is only intermittent. At first glance I suspect the problem is that the == operator isn't technically correct /bin/sh syntax and should just be = instead.

If I'm not mistaken that version of Ubuntu links sh to dash and because of that only implements POSIX compliant sh syntax, which == isn't. It's fairly common in other distros to link sh to bash instead, which is why it is usually just fine, since that is acceptable bash syntax.

You could probably easily try that out by making that change locally for yourself. I'll certainly be curious if that works for you. You're even welcome to submit a PR to correct it but I'll also work to get that addressed on our end.